diff --git a/Babel/Babel.Core/App.cs b/Babel/Babel.Core/App.cs index 19ef34cf..ba1812e8 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..84773793 100644 --- a/Babel/Babel.Core/ViewModels/FirstViewModel.cs +++ b/Babel/Babel.Core/ViewModels/FirstViewModel.cs @@ -1,47 +1,40 @@ -using MvvmCross.Core.ViewModels; -using MvvmCross.Plugins.JsonLocalization; -using System.Windows.Input; +using MvvmCross.Commands; +using MvvmCross.Navigation; +using MvvmCross.Plugin.JsonLocalization; namespace Babel.Core.ViewModels { - public class FirstViewModel - : BaseViewModel + public class FirstViewModel : BaseViewModel { private readonly IMvxTextProviderBuilder _builder; + private readonly IMvxNavigationService _navigationService; + private string _hello; - public FirstViewModel(IMvxTextProviderBuilder builder) + public FirstViewModel(IMvxTextProviderBuilder builder, IMvxNavigationService navigationService) { _builder = builder; + _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(() => ShowViewModel()); } - } + 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); } } -} \ No newline at end of file +} diff --git a/Babel/Babel.Core/ViewModels/SecondViewModel.cs b/Babel/Babel.Core/ViewModels/SecondViewModel.cs index 599562d9..ee9aa233 100644 --- a/Babel/Babel.Core/ViewModels/SecondViewModel.cs +++ b/Babel/Babel.Core/ViewModels/SecondViewModel.cs @@ -1,7 +1,15 @@ +using MvvmCross.Commands; +using MvvmCross.Navigation; + namespace Babel.Core.ViewModels { - public class SecondViewModel - : BaseViewModel + public class SecondViewModel : BaseViewModel { + public SecondViewModel(IMvxNavigationService navigationService) + { + GoBackCommand = new MvxCommand(() => navigationService.Navigate()); + } + + public IMvxCommand GoBackCommand { get; } } -} \ 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 diff --git a/Babel/Babel.Droid/Babel.Droid.csproj b/Babel/Babel.Droid/Babel.Droid.csproj index 0204a906..c2a7fc03 100644 --- a/Babel/Babel.Droid/Babel.Droid.csproj +++ b/Babel/Babel.Droid/Babel.Droid.csproj @@ -17,7 +17,7 @@ Off Properties\AndroidManifest.xml False - v5.0 + v9.0 true @@ -41,65 +41,10 @@ SdkOnly + - - ..\packages\MvvmCross.Binding.4.0.0-beta8\lib\MonoAndroid\MvvmCross.Binding.dll - True - - - ..\packages\MvvmCross.Binding.4.0.0-beta8\lib\MonoAndroid\MvvmCross.Binding.Droid.dll - True - - - ..\packages\MvvmCross.Core.4.0.0-beta8\lib\MonoAndroid\MvvmCross.Core.dll - True - - - ..\packages\MvvmCross.Core.4.0.0-beta8\lib\MonoAndroid\MvvmCross.Droid.dll - True - - - ..\packages\MvvmCross.Platform.4.0.0-beta8\lib\MonoAndroid\MvvmCross.Localization.dll - True - - - ..\packages\MvvmCross.Platform.4.0.0-beta8\lib\MonoAndroid\MvvmCross.Platform.dll - True - - - ..\packages\MvvmCross.Platform.4.0.0-beta8\lib\MonoAndroid\MvvmCross.Platform.Droid.dll - True - - - ..\packages\MvvmCross.Plugin.File.4.0.0-beta8\lib\MonoAndroid\MvvmCross.Plugins.File.dll - True - - - ..\packages\MvvmCross.Plugin.File.4.0.0-beta8\lib\MonoAndroid\MvvmCross.Plugins.File.Droid.dll - True - - - ..\packages\MvvmCross.Plugin.Json.4.0.0-beta8\lib\MonoAndroid\MvvmCross.Plugins.Json.dll - True - - - ..\packages\MvvmCross.Plugin.JsonLocalization.4.0.0-beta8\lib\MonoAndroid\MvvmCross.Plugins.JsonLocalization.dll - True - - - ..\packages\MvvmCross.Plugin.ResourceLoader.4.0.0-beta8\lib\MonoAndroid\MvvmCross.Plugins.ResourceLoader.dll - True - - - ..\packages\MvvmCross.Plugin.ResourceLoader.4.0.0-beta8\lib\MonoAndroid\MvvmCross.Plugins.ResourceLoader.Droid.dll - True - - - ..\packages\Newtonsoft.Json.8.0.2\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll - True - @@ -118,17 +63,13 @@ - - - - - + @@ -149,8 +90,6 @@ Assets\BabelResources\Text\SecondViewModel.json - - @@ -173,7 +112,11 @@ - + + + + 6.2.3 + \ 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 @@ - - + + - - +