Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Babel/Babel.Core/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ private void InitializeText()
Mvx.IoCProvider.RegisterSingleton<IMvxTextProvider>(builder.TextProvider);
}
}
}
}
29 changes: 10 additions & 19 deletions Babel/Babel.Core/ViewModels/FirstViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,49 +1,40 @@
using MvvmCross.Commands;
using MvvmCross.Navigation;
using MvvmCross.Plugin.JsonLocalization;
using System.Windows.Input;

namespace Babel.Core.ViewModels
{
public class FirstViewModel : BaseViewModel
{
private readonly IMvxTextProviderBuilder _builder;
private readonly IMvxNavigationService _navigationService;
private string _hello;

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(() => _navigationService.Navigate<SecondViewModel>()); }
}
public IMvxCommand GoCommand => new MvxCommand(() => _navigationService.Navigate<SecondViewModel>());

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);
}
}
}
9 changes: 9 additions & 0 deletions Babel/Babel.Core/ViewModels/SecondViewModel.cs
Original file line number Diff line number Diff line change
@@ -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<FirstViewModel>());
}

public IMvxCommand GoBackCommand { get; }
}
}
51 changes: 0 additions & 51 deletions Babel/Babel.Wpf/App.Xaml.Mvx.cs

This file was deleted.

18 changes: 5 additions & 13 deletions Babel/Babel.Wpf/App.config
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
13 changes: 7 additions & 6 deletions Babel/Babel.Wpf/App.xaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<Application x:Class="Babel.Wpf.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Babel.Wpf.Converters"
StartupUri="MainWindow.xaml">
<views:MvxApplication xmlns:views="clr-namespace:MvvmCross.Platforms.Wpf.Views;assembly=MvvmCross.Platforms.Wpf"
x:Class="Babel.Wpf.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Babel.Wpf.Converters"
StartupUri="MainWindow.xaml">
<Application.Resources>
<converters:NativeLanguageConverter x:Key="Language" />
</Application.Resources>
</Application>
</views:MvxApplication>
14 changes: 8 additions & 6 deletions Babel/Babel.Wpf/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using System.Windows;
using MvvmCross.Core;
using MvvmCross.Platforms.Wpf.Views;

namespace Babel.Wpf
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
public partial class App : MvxApplication
{
protected override void RegisterSetup()
{
this.RegisterSetupType<Setup>();
}
}
}
}
77 changes: 13 additions & 64 deletions Babel/Babel.Wpf/Babel.Wpf.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{27D3D336-3D07-4FE2-A22A-39EB73339F95}</ProjectGuid>
<ProjectGuid>{FBC2EEDD-F89A-4204-8A84-0D2B178105BC}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Babel.Wpf</RootNamespace>
<AssemblyName>Babel.Wpf</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -34,57 +34,14 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="MvvmCross.Binding, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmCross.Binding.4.0.0-beta8\lib\net45\MvvmCross.Binding.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MvvmCross.Core, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmCross.Core.4.0.0-beta8\lib\net45\MvvmCross.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MvvmCross.Localization, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmCross.Platform.4.0.0-beta8\lib\net45\MvvmCross.Localization.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MvvmCross.Platform, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmCross.Platform.4.0.0-beta8\lib\net45\MvvmCross.Platform.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MvvmCross.Platform.Wpf, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmCross.Platform.4.0.0-beta8\lib\net45\MvvmCross.Platform.Wpf.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MvvmCross.Plugins.Json, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmCross.Plugin.Json.4.0.0-beta8\lib\net45\MvvmCross.Plugins.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MvvmCross.Plugins.JsonLocalization, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmCross.Plugin.JsonLocalization.4.0.0-beta8\lib\dotnet\MvvmCross.Plugins.JsonLocalization.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MvvmCross.Plugins.ResourceLoader, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmCross.Plugin.ResourceLoader.4.0.0-beta8\lib\net45\MvvmCross.Plugins.ResourceLoader.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MvvmCross.Plugins.ResourceLoader.Wpf, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmCross.Plugin.ResourceLoader.4.0.0-beta8\lib\net45\MvvmCross.Plugins.ResourceLoader.Wpf.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MvvmCross.Wpf, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmCross.Core.4.0.0-beta8\lib\net45\MvvmCross.Wpf.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
Expand All @@ -97,11 +54,7 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="App.Xaml.Mvx.cs" />
<Compile Include="Bootstrap\JsonPluginBootstrap.cs" />
<Compile Include="Bootstrap\ResourceLoaderPluginBootstrap.cs" />
<Compile Include="Converters\NativeLanguageConverter.cs" />
<Compile Include="DebugTrace.cs" />
<Compile Include="Setup.cs" />
<Compile Include="Views\FirstView.xaml.cs">
<DependentUpon>FirstView.xaml</DependentUpon>
Expand Down Expand Up @@ -172,8 +125,6 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages-old.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand All @@ -183,21 +134,19 @@
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MvvmCross.Platforms.Wpf">
<Version>6.2.3</Version>
</PackageReference>
<PackageReference Include="MvvmCross.Plugin.JsonLocalization">
<Version>6.2.3</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Babel.Core\Babel.Core.csproj">
<Project>{f7103111-05ce-4859-a81f-f7d88caee12e}</Project>
<Name>Babel.Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Resource Include="ToDo-MvvmCross\_ Wpf UI.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
9 changes: 0 additions & 9 deletions Babel/Babel.Wpf/Bootstrap/JsonPluginBootstrap.cs

This file was deleted.

9 changes: 0 additions & 9 deletions Babel/Babel.Wpf/Bootstrap/ResourceLoaderPluginBootstrap.cs

This file was deleted.

2 changes: 1 addition & 1 deletion Babel/Babel.Wpf/Converters/NativeLanguageConverter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using MvvmCross.Localization;
using MvvmCross.Platform.Wpf.Converters;
using MvvmCross.Platforms.Wpf.Converters;

namespace Babel.Wpf.Converters
{
Expand Down
31 changes: 0 additions & 31 deletions Babel/Babel.Wpf/DebugTrace.cs

This file was deleted.

Loading