From 6ad58a4a55f631801149ba38bb939408d75481b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20PoL=C3=A1KoSz?= Date: Tue, 14 May 2019 12:26:10 +0200 Subject: [PATCH 1/5] Upgrade Babel.Core to MvvmCross 6.2.3 --- Babel/Babel.Core/App.cs | 12 +-- Babel/Babel.Core/Babel.Core.csproj | 94 ++----------------- Babel/Babel.Core/Properties/AssemblyInfo.cs | 28 ------ .../Services/TextProviderBuilder.cs | 7 +- Babel/Babel.Core/ViewModels/BaseViewModel.cs | 7 +- Babel/Babel.Core/ViewModels/FirstViewModel.cs | 16 ++-- .../Babel.Core/ViewModels/SecondViewModel.cs | 5 +- Babel/Babel.Core/packages-old.config | 13 --- Babel/Babel.Core/packages.config | 11 --- 9 files changed, 30 insertions(+), 163 deletions(-) delete mode 100644 Babel/Babel.Core/Properties/AssemblyInfo.cs delete mode 100644 Babel/Babel.Core/packages-old.config delete mode 100644 Babel/Babel.Core/packages.config diff --git a/Babel/Babel.Core/App.cs b/Babel/Babel.Core/App.cs index 19ef34cf..f2ccf8ce 100644 --- a/Babel/Babel.Core/App.cs +++ b/Babel/Babel.Core/App.cs @@ -1,9 +1,9 @@ using Babel.Core.Services; -using MvvmCross.Core.ViewModels; +using MvvmCross; +using MvvmCross.IoC; using MvvmCross.Localization; -using MvvmCross.Platform; -using MvvmCross.Platform.IoC; -using MvvmCross.Plugins.JsonLocalization; +using MvvmCross.Plugin.JsonLocalization; +using MvvmCross.ViewModels; namespace Babel.Core { @@ -23,8 +23,8 @@ public override void Initialize() private void InitializeText() { var builder = new TextProviderBuilder(); - Mvx.RegisterSingleton(builder); - Mvx.RegisterSingleton(builder.TextProvider); + Mvx.IoCProvider.RegisterSingleton(builder); + Mvx.IoCProvider.RegisterSingleton(builder.TextProvider); } } } \ No newline at end of file diff --git a/Babel/Babel.Core/Babel.Core.csproj b/Babel/Babel.Core/Babel.Core.csproj index 79683f80..272ace46 100644 --- a/Babel/Babel.Core/Babel.Core.csproj +++ b/Babel/Babel.Core/Babel.Core.csproj @@ -1,91 +1,11 @@ - - - + + - 10.0 - Debug - AnyCPU - {F7103111-05CE-4859-A81F-F7D88CAEE12E} - Library - Properties - Babel.Core - Babel.Core - v4.5 - Profile259 - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + netstandard2.0 - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - + - - ..\packages\MvvmCross.Binding.4.0.0-beta8\lib\portable-net45+win+wpa81+wp80\MvvmCross.Binding.dll - True - - - ..\packages\MvvmCross.Core.4.0.0-beta8\lib\portable-net45+win+wpa81+wp80\MvvmCross.Core.dll - True - - - ..\packages\MvvmCross.Platform.4.0.0-beta8\lib\portable-net45+win+wpa81+wp80\MvvmCross.Localization.dll - True - - - ..\packages\MvvmCross.Platform.4.0.0-beta8\lib\portable-net45+win+wpa81+wp80\MvvmCross.Platform.dll - True - - - ..\packages\MvvmCross.Plugin.Json.4.0.0-beta8\lib\portable-net45+win+wpa81+wp80\MvvmCross.Plugins.Json.dll - True - - - ..\packages\MvvmCross.Plugin.JsonLocalization.4.0.0-beta8\lib\portable-net45+win+wpa81+wp80\MvvmCross.Plugins.JsonLocalization.dll - True - - - ..\packages\MvvmCross.Plugin.ResourceLoader.4.0.0-beta8\lib\portable-win+net45+wp8+win8+wpa81\MvvmCross.Plugins.ResourceLoader.dll - True - - - ..\packages\Newtonsoft.Json.8.0.2\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll - True - + + - - - \ No newline at end of file + diff --git a/Babel/Babel.Core/Properties/AssemblyInfo.cs b/Babel/Babel.Core/Properties/AssemblyInfo.cs deleted file mode 100644 index 008bd1ca..00000000 --- a/Babel/Babel.Core/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Reflection; -using System.Resources; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Babel.Core")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Babel.Core")] -[assembly: AssemblyCopyright("Copyright © 2013")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: NeutralResourcesLanguage("en")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/Babel/Babel.Core/Services/TextProviderBuilder.cs b/Babel/Babel.Core/Services/TextProviderBuilder.cs index 2a1bb5ae..6aca7cd2 100644 --- a/Babel/Babel.Core/Services/TextProviderBuilder.cs +++ b/Babel/Babel.Core/Services/TextProviderBuilder.cs @@ -1,13 +1,12 @@ -using MvvmCross.Platform.IoC; -using MvvmCross.Plugins.JsonLocalization; +using MvvmCross.IoC; +using MvvmCross.Plugin.JsonLocalization; using System.Collections.Generic; using System.Linq; using System.Reflection; namespace Babel.Core.Services { - public class TextProviderBuilder - : MvxTextProviderBuilder + public class TextProviderBuilder : MvxTextProviderBuilder { public TextProviderBuilder() : base(Constants.GeneralNamespace, Constants.RootFolderForResources) diff --git a/Babel/Babel.Core/ViewModels/BaseViewModel.cs b/Babel/Babel.Core/ViewModels/BaseViewModel.cs index 0f5d401c..ab658a86 100644 --- a/Babel/Babel.Core/ViewModels/BaseViewModel.cs +++ b/Babel/Babel.Core/ViewModels/BaseViewModel.cs @@ -1,14 +1,13 @@ -using MvvmCross.Core.ViewModels; using MvvmCross.Localization; +using MvvmCross.ViewModels; namespace Babel.Core.ViewModels { - public abstract class BaseViewModel - : MvxViewModel + public abstract class BaseViewModel : MvxViewModel { public IMvxLanguageBinder TextSource { get { return new MvxLanguageBinder(Constants.GeneralNamespace, GetType().Name); } } } -} \ No newline at end of file +} diff --git a/Babel/Babel.Core/ViewModels/FirstViewModel.cs b/Babel/Babel.Core/ViewModels/FirstViewModel.cs index 32a28515..2754fddb 100644 --- a/Babel/Babel.Core/ViewModels/FirstViewModel.cs +++ b/Babel/Babel.Core/ViewModels/FirstViewModel.cs @@ -1,17 +1,19 @@ -using MvvmCross.Core.ViewModels; -using MvvmCross.Plugins.JsonLocalization; +using MvvmCross.Commands; +using MvvmCross.Navigation; +using MvvmCross.Plugin.JsonLocalization; using System.Windows.Input; namespace Babel.Core.ViewModels { - public class FirstViewModel - : BaseViewModel + public class FirstViewModel : BaseViewModel { private readonly IMvxTextProviderBuilder _builder; + private readonly IMvxNavigationService _navigationService; - public FirstViewModel(IMvxTextProviderBuilder builder) + public FirstViewModel(IMvxTextProviderBuilder builder, IMvxNavigationService navigationService) { _builder = builder; + _navigationService = navigationService; } public ICommand LolCatCommand @@ -36,7 +38,7 @@ private void PickLanguage(string which) public ICommand GoCommand { - get { return new MvxCommand(() => ShowViewModel()); } + get { return new MvxCommand(() => _navigationService.Navigate()); } } public ICommand ForceTextRefreshCommand @@ -44,4 +46,4 @@ public ICommand ForceTextRefreshCommand get { return new MvxCommand(() => RaisePropertyChanged(() => TextSource)); } } } -} \ No newline at end of file +} diff --git a/Babel/Babel.Core/ViewModels/SecondViewModel.cs b/Babel/Babel.Core/ViewModels/SecondViewModel.cs index 599562d9..d1fb7a0d 100644 --- a/Babel/Babel.Core/ViewModels/SecondViewModel.cs +++ b/Babel/Babel.Core/ViewModels/SecondViewModel.cs @@ -1,7 +1,6 @@ namespace Babel.Core.ViewModels { - public class SecondViewModel - : BaseViewModel + public class SecondViewModel : BaseViewModel { } -} \ No newline at end of file +} diff --git a/Babel/Babel.Core/packages-old.config b/Babel/Babel.Core/packages-old.config deleted file mode 100644 index 0829d54a..00000000 --- a/Babel/Babel.Core/packages-old.config +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/Babel/Babel.Core/packages.config b/Babel/Babel.Core/packages.config deleted file mode 100644 index 12d72a75..00000000 --- a/Babel/Babel.Core/packages.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file From 53fa4f4b613118e5ceca8f4ec1e0c88480131873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20PoL=C3=A1KoSz?= Date: Tue, 14 May 2019 12:26:34 +0200 Subject: [PATCH 2/5] Upgrade Babel.WPF to MvvmCross 6.2.3 --- Babel/Babel.Core/App.cs | 2 +- Babel/Babel.Core/ViewModels/FirstViewModel.cs | 29 ++--- .../Babel.Core/ViewModels/SecondViewModel.cs | 9 ++ Babel/Babel.Wpf/App.Xaml.Mvx.cs | 51 --------- Babel/Babel.Wpf/App.config | 18 +-- Babel/Babel.Wpf/App.xaml | 13 ++- Babel/Babel.Wpf/App.xaml.cs | 14 ++- Babel/Babel.Wpf/Babel.Wpf.csproj | 77 +++---------- .../Bootstrap/JsonPluginBootstrap.cs | 9 -- .../ResourceLoaderPluginBootstrap.cs | 9 -- .../Converters/NativeLanguageConverter.cs | 2 +- Babel/Babel.Wpf/DebugTrace.cs | 31 ------ Babel/Babel.Wpf/MainWindow.xaml | 15 ++- Babel/Babel.Wpf/MainWindow.xaml.cs | 9 +- .../Properties/Resources.Designer.cs | 46 ++++---- .../Babel.Wpf/Properties/Settings.Designer.cs | 24 ++-- Babel/Babel.Wpf/Setup.cs | 27 ++--- Babel/Babel.Wpf/ToDo-MvvmCross/_ Wpf UI.txt | 3 - Babel/Babel.Wpf/Views/FirstView.xaml | 50 +++++++-- Babel/Babel.Wpf/Views/FirstView.xaml.cs | 4 +- Babel/Babel.Wpf/Views/SecondView.xaml | 26 +++-- Babel/Babel.Wpf/Views/SecondView.xaml.cs | 5 +- Babel/Babel.Wpf/packages-old.config | 13 --- Babel/Babel.Wpf/packages.config | 13 --- Babel/Babel.sln | 103 +++++++++++------- 25 files changed, 224 insertions(+), 378 deletions(-) delete mode 100644 Babel/Babel.Wpf/App.Xaml.Mvx.cs delete mode 100644 Babel/Babel.Wpf/Bootstrap/JsonPluginBootstrap.cs delete mode 100644 Babel/Babel.Wpf/Bootstrap/ResourceLoaderPluginBootstrap.cs delete mode 100644 Babel/Babel.Wpf/DebugTrace.cs delete mode 100644 Babel/Babel.Wpf/ToDo-MvvmCross/_ Wpf UI.txt delete mode 100644 Babel/Babel.Wpf/packages-old.config delete mode 100644 Babel/Babel.Wpf/packages.config diff --git a/Babel/Babel.Core/App.cs b/Babel/Babel.Core/App.cs index f2ccf8ce..ba1812e8 100644 --- a/Babel/Babel.Core/App.cs +++ b/Babel/Babel.Core/App.cs @@ -27,4 +27,4 @@ private void InitializeText() Mvx.IoCProvider.RegisterSingleton(builder.TextProvider); } } -} \ No newline at end of file +} diff --git a/Babel/Babel.Core/ViewModels/FirstViewModel.cs b/Babel/Babel.Core/ViewModels/FirstViewModel.cs index 2754fddb..84773793 100644 --- a/Babel/Babel.Core/ViewModels/FirstViewModel.cs +++ b/Babel/Babel.Core/ViewModels/FirstViewModel.cs @@ -1,7 +1,6 @@ using MvvmCross.Commands; using MvvmCross.Navigation; using MvvmCross.Plugin.JsonLocalization; -using System.Windows.Input; namespace Babel.Core.ViewModels { @@ -9,6 +8,7 @@ public class FirstViewModel : BaseViewModel { private readonly IMvxTextProviderBuilder _builder; private readonly IMvxNavigationService _navigationService; + private string _hello; public FirstViewModel(IMvxTextProviderBuilder builder, IMvxNavigationService navigationService) { @@ -16,34 +16,25 @@ public FirstViewModel(IMvxTextProviderBuilder builder, IMvxNavigationService nav _navigationService = navigationService; } - public ICommand LolCatCommand - { - get { return new MvxCommand(() => PickLanguage("LolCat")); } - } + public IMvxCommand LolCatCommand => new MvxCommand(() => PickLanguage("LolCat")); - public ICommand ProperEnglishCommand - { - get { return new MvxCommand(() => PickLanguage("ProperEnglish")); } - } + public IMvxCommand ProperEnglishCommand => new MvxCommand(() => PickLanguage("ProperEnglish")); - public ICommand DefaultCommand - { - get { return new MvxCommand(() => PickLanguage(string.Empty)); } - } + public IMvxCommand DefaultCommand => new MvxCommand(() => PickLanguage(string.Empty)); private void PickLanguage(string which) { _builder.LoadResources(which); } - public ICommand GoCommand - { - get { return new MvxCommand(() => _navigationService.Navigate()); } - } + public IMvxCommand GoCommand => new MvxCommand(() => _navigationService.Navigate()); + + public IMvxCommand ForceTextRefreshCommand => new MvxCommand(() => RaisePropertyChanged(() => TextSource)); - public ICommand ForceTextRefreshCommand + public string Hello { - get { return new MvxCommand(() => RaisePropertyChanged(() => TextSource)); } + get => _hello; + set => SetProperty(ref _hello, value); } } } diff --git a/Babel/Babel.Core/ViewModels/SecondViewModel.cs b/Babel/Babel.Core/ViewModels/SecondViewModel.cs index d1fb7a0d..ee9aa233 100644 --- a/Babel/Babel.Core/ViewModels/SecondViewModel.cs +++ b/Babel/Babel.Core/ViewModels/SecondViewModel.cs @@ -1,6 +1,15 @@ +using MvvmCross.Commands; +using MvvmCross.Navigation; + namespace Babel.Core.ViewModels { public class SecondViewModel : BaseViewModel { + public SecondViewModel(IMvxNavigationService navigationService) + { + GoBackCommand = new MvxCommand(() => navigationService.Navigate()); + } + + public IMvxCommand GoBackCommand { get; } } } diff --git a/Babel/Babel.Wpf/App.Xaml.Mvx.cs b/Babel/Babel.Wpf/App.Xaml.Mvx.cs deleted file mode 100644 index 42a45223..00000000 --- a/Babel/Babel.Wpf/App.Xaml.Mvx.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Windows; -using MvvmCross.Core.ViewModels; -using MvvmCross.Platform; -using MvvmCross.Wpf.Views; - -namespace Babel.Wpf -{ - public partial class App : Application - { - private bool _setupComplete; - - private void DoSetup() - { - LoadMvxAssemblyResources(); - - var presenter = new MvxSimpleWpfViewPresenter(MainWindow); - - var setup = new Setup(Dispatcher, presenter); - setup.Initialize(); - - var start = Mvx.Resolve(); - start.Start(); - - _setupComplete = true; - } - - protected override void OnActivated(EventArgs e) - { - if (!_setupComplete) - { - DoSetup(); - } - - base.OnActivated(e); - } - - private void LoadMvxAssemblyResources() - { - for (var i = 0;; i++) - { - var key = "MvxAssemblyImport" + i; - var data = TryFindResource(key); - if (data == null) - { - return; - } - } - } - } -} \ No newline at end of file diff --git a/Babel/Babel.Wpf/App.config b/Babel/Babel.Wpf/App.config index f19eda4b..2a5e54d5 100644 --- a/Babel/Babel.Wpf/App.config +++ b/Babel/Babel.Wpf/App.config @@ -1,14 +1,6 @@ - + - - - - - - - - - - - - \ No newline at end of file + + + + diff --git a/Babel/Babel.Wpf/App.xaml b/Babel/Babel.Wpf/App.xaml index 42cf4d84..d6db0bff 100644 --- a/Babel/Babel.Wpf/App.xaml +++ b/Babel/Babel.Wpf/App.xaml @@ -1,9 +1,10 @@ - + - \ No newline at end of file + diff --git a/Babel/Babel.Wpf/App.xaml.cs b/Babel/Babel.Wpf/App.xaml.cs index 7c2bcffb..4467db22 100644 --- a/Babel/Babel.Wpf/App.xaml.cs +++ b/Babel/Babel.Wpf/App.xaml.cs @@ -1,11 +1,13 @@ -using System.Windows; +using MvvmCross.Core; +using MvvmCross.Platforms.Wpf.Views; namespace Babel.Wpf { - /// - /// Interaction logic for App.xaml - /// - public partial class App : Application + public partial class App : MvxApplication { + protected override void RegisterSetup() + { + this.RegisterSetupType(); + } } -} \ No newline at end of file +} diff --git a/Babel/Babel.Wpf/Babel.Wpf.csproj b/Babel/Babel.Wpf/Babel.Wpf.csproj index 4b445432..b6762074 100644 --- a/Babel/Babel.Wpf/Babel.Wpf.csproj +++ b/Babel/Babel.Wpf/Babel.Wpf.csproj @@ -1,18 +1,18 @@  - + Debug AnyCPU - {27D3D336-3D07-4FE2-A22A-39EB73339F95} + {FBC2EEDD-F89A-4204-8A84-0D2B178105BC} WinExe - Properties Babel.Wpf Babel.Wpf - v4.5 + v4.6.1 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 + true AnyCPU @@ -34,50 +34,6 @@ 4 - - ..\packages\MvvmCross.Binding.4.0.0-beta8\lib\net45\MvvmCross.Binding.dll - True - - - ..\packages\MvvmCross.Core.4.0.0-beta8\lib\net45\MvvmCross.Core.dll - True - - - ..\packages\MvvmCross.Platform.4.0.0-beta8\lib\net45\MvvmCross.Localization.dll - True - - - ..\packages\MvvmCross.Platform.4.0.0-beta8\lib\net45\MvvmCross.Platform.dll - True - - - ..\packages\MvvmCross.Platform.4.0.0-beta8\lib\net45\MvvmCross.Platform.Wpf.dll - True - - - ..\packages\MvvmCross.Plugin.Json.4.0.0-beta8\lib\net45\MvvmCross.Plugins.Json.dll - True - - - ..\packages\MvvmCross.Plugin.JsonLocalization.4.0.0-beta8\lib\dotnet\MvvmCross.Plugins.JsonLocalization.dll - True - - - ..\packages\MvvmCross.Plugin.ResourceLoader.4.0.0-beta8\lib\net45\MvvmCross.Plugins.ResourceLoader.dll - True - - - ..\packages\MvvmCross.Plugin.ResourceLoader.4.0.0-beta8\lib\net45\MvvmCross.Plugins.ResourceLoader.Wpf.dll - True - - - ..\packages\MvvmCross.Core.4.0.0-beta8\lib\net45\MvvmCross.Wpf.dll - True - - - ..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll - True - @@ -85,6 +41,7 @@ + 4.0 @@ -97,11 +54,7 @@ MSBuild:Compile Designer - - - - FirstView.xaml @@ -172,8 +125,6 @@ ResXFileCodeGenerator Resources.Designer.cs - - SettingsSingleFileGenerator Settings.Designer.cs @@ -183,21 +134,19 @@ + + + 6.2.3 + + + 6.2.3 + + {f7103111-05ce-4859-a81f-f7d88caee12e} Babel.Core - - - - \ No newline at end of file diff --git a/Babel/Babel.Wpf/Bootstrap/JsonPluginBootstrap.cs b/Babel/Babel.Wpf/Bootstrap/JsonPluginBootstrap.cs deleted file mode 100644 index 41adef4e..00000000 --- a/Babel/Babel.Wpf/Bootstrap/JsonPluginBootstrap.cs +++ /dev/null @@ -1,9 +0,0 @@ -using MvvmCross.Platform.Plugins; - -namespace Babel.Wpf.Bootstrap -{ - public class JsonPluginBootstrap - : MvxPluginBootstrapAction - { - } -} \ No newline at end of file diff --git a/Babel/Babel.Wpf/Bootstrap/ResourceLoaderPluginBootstrap.cs b/Babel/Babel.Wpf/Bootstrap/ResourceLoaderPluginBootstrap.cs deleted file mode 100644 index 9b9e1422..00000000 --- a/Babel/Babel.Wpf/Bootstrap/ResourceLoaderPluginBootstrap.cs +++ /dev/null @@ -1,9 +0,0 @@ -using MvvmCross.Platform.Plugins; - -namespace Babel.Wpf.Bootstrap -{ - public class ResourceLoaderPluginBootstrap - : MvxPluginBootstrapAction - { - } -} \ No newline at end of file diff --git a/Babel/Babel.Wpf/Converters/NativeLanguageConverter.cs b/Babel/Babel.Wpf/Converters/NativeLanguageConverter.cs index b128fe72..18e3d55b 100644 --- a/Babel/Babel.Wpf/Converters/NativeLanguageConverter.cs +++ b/Babel/Babel.Wpf/Converters/NativeLanguageConverter.cs @@ -1,5 +1,5 @@ using MvvmCross.Localization; -using MvvmCross.Platform.Wpf.Converters; +using MvvmCross.Platforms.Wpf.Converters; namespace Babel.Wpf.Converters { diff --git a/Babel/Babel.Wpf/DebugTrace.cs b/Babel/Babel.Wpf/DebugTrace.cs deleted file mode 100644 index e1567e2e..00000000 --- a/Babel/Babel.Wpf/DebugTrace.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Diagnostics; -using MvvmCross.Platform.Platform; - -namespace Babel.Wpf -{ - public class DebugTrace : IMvxTrace - { - public void Trace(MvxTraceLevel level, string tag, Func message) - { - Debug.WriteLine(tag + ":" + level + ":" + message()); - } - - public void Trace(MvxTraceLevel level, string tag, string message) - { - Debug.WriteLine(tag + ":" + level + ":" + message); - } - - public void Trace(MvxTraceLevel level, string tag, string message, params object[] args) - { - try - { - Debug.WriteLine(tag + ":" + level + ":" + message, args); - } - catch (FormatException) - { - Trace(MvxTraceLevel.Error, tag, "Exception during trace of {0} {1}", level, message); - } - } - } -} diff --git a/Babel/Babel.Wpf/MainWindow.xaml b/Babel/Babel.Wpf/MainWindow.xaml index c6ea95ad..72bbfff4 100644 --- a/Babel/Babel.Wpf/MainWindow.xaml +++ b/Babel/Babel.Wpf/MainWindow.xaml @@ -1,7 +1,12 @@ - + + - \ No newline at end of file + diff --git a/Babel/Babel.Wpf/MainWindow.xaml.cs b/Babel/Babel.Wpf/MainWindow.xaml.cs index 493f273e..6913255c 100644 --- a/Babel/Babel.Wpf/MainWindow.xaml.cs +++ b/Babel/Babel.Wpf/MainWindow.xaml.cs @@ -1,15 +1,12 @@ -using System.Windows; +using MvvmCross.Platforms.Wpf.Views; namespace Babel.Wpf { - /// - /// Interaction logic for MainWindow.xaml - /// - public partial class MainWindow : Window + public partial class MainWindow : MvxWindow { public MainWindow() { InitializeComponent(); } } -} \ No newline at end of file +} diff --git a/Babel/Babel.Wpf/Properties/Resources.Designer.cs b/Babel/Babel.Wpf/Properties/Resources.Designer.cs index 0437e813..ac109279 100644 --- a/Babel/Babel.Wpf/Properties/Resources.Designer.cs +++ b/Babel/Babel.Wpf/Properties/Resources.Designer.cs @@ -1,17 +1,17 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18046 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ -namespace Babel.Wpf.Properties -{ - - +namespace Babel.Wpf.Properties { + using System; + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -19,51 +19,43 @@ namespace Babel.Wpf.Properties // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - + internal class Resources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { + internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Babel.Wpf.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { + internal static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } diff --git a/Babel/Babel.Wpf/Properties/Settings.Designer.cs b/Babel/Babel.Wpf/Properties/Settings.Designer.cs index e22551ab..c7a3479a 100644 --- a/Babel/Babel.Wpf/Properties/Settings.Designer.cs +++ b/Babel/Babel.Wpf/Properties/Settings.Designer.cs @@ -1,28 +1,24 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18046 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ -namespace Babel.Wpf.Properties -{ - - +namespace Babel.Wpf.Properties { + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { + + public static Settings Default { + get { return defaultInstance; } } diff --git a/Babel/Babel.Wpf/Setup.cs b/Babel/Babel.Wpf/Setup.cs index 63467926..c7c2de8a 100644 --- a/Babel/Babel.Wpf/Setup.cs +++ b/Babel/Babel.Wpf/Setup.cs @@ -1,27 +1,20 @@ -using System.Windows.Threading; -using MvvmCross.Core.ViewModels; -using MvvmCross.Platform.Platform; -using MvvmCross.Wpf.Platform; -using MvvmCross.Wpf.Views; +using MvvmCross; +using MvvmCross.Base; +using MvvmCross.Platforms.Wpf.Core; +using MvvmCross.Plugin; +using MvvmCross.Plugin.ResourceLoader.Platforms.Wpf; namespace Babel.Wpf { - public class Setup - : MvxWpfSetup + public class Setup : MvxWpfSetup { - public Setup(Dispatcher dispatcher, IMvxWpfViewPresenter presenter) - : base(dispatcher, presenter) + public override void LoadPlugins(IMvxPluginManager pluginManager) { - } + base.LoadPlugins(pluginManager); - protected override IMvxApplication CreateApp() - { - return new Core.App(); - } + Mvx.IoCProvider.RegisterType(); - protected override IMvxTrace CreateDebugTrace() - { - return new DebugTrace(); + pluginManager.EnsurePluginLoaded(); } } } diff --git a/Babel/Babel.Wpf/ToDo-MvvmCross/_ Wpf UI.txt b/Babel/Babel.Wpf/ToDo-MvvmCross/_ Wpf UI.txt deleted file mode 100644 index 0f2e7d75..00000000 --- a/Babel/Babel.Wpf/ToDo-MvvmCross/_ Wpf UI.txt +++ /dev/null @@ -1,3 +0,0 @@ -The only step to get this Wpf .Net 4.5 UI working is: - -1. Add a reference to your Core PCL project diff --git a/Babel/Babel.Wpf/Views/FirstView.xaml b/Babel/Babel.Wpf/Views/FirstView.xaml index 2b5722d7..50675ec2 100644 --- a/Babel/Babel.Wpf/Views/FirstView.xaml +++ b/Babel/Babel.Wpf/Views/FirstView.xaml @@ -1,16 +1,42 @@ - - + + - - +