Skip to content

Commit

Permalink
fix: settings params init & feat: 0.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gosha20777 committed Aug 12, 2020
1 parent 74f8f63 commit 92888d7
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/LacmusApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<Company>Lacmus Foundation</Company>
<AssemblyVersion>0.4.2.0</AssemblyVersion>
<FileVersion>0.4.2.0</FileVersion>
<AssemblyVersion>0.4.3.0</AssemblyVersion>
<FileVersion>0.4.3.0</FileVersion>
</PropertyGroup>
<ItemGroup>
<Compile Update="**\*.xaml.cs">
Expand Down
33 changes: 33 additions & 0 deletions src/ViewModels/SettingsWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public SettingsWindowViewModel(SettingsWindow window, LocalizationContext contex
_config = config;
_newConfig = AppConfig.DeepCopy(_config);
_applicationStatusManager = manager;
InitView();

this.WhenAnyValue(x => x.ThemeIndex)
.Skip(1)
Expand Down Expand Up @@ -80,6 +81,38 @@ private void SetupCommands()
UpdateModelStatusCommand = ReactiveCommand.Create(UpdateModelStatus);
OpenModelMnagerCommand = ReactiveCommand.Create(OpenModelManager);
}

private void InitView()
{
switch (LocalizationContext.Language)
{
case Language.English:
LanguageIndex = 0;
break;
case Language.Russian:
LanguageIndex = 1;
break;
}

switch (_settingsThemeManager.CurrentTheme)
{
case ThemeManager.Theme.Citrus:
ThemeIndex = 0;
break;
case ThemeManager.Theme.Rust:
ThemeIndex = 1;
break;
case ThemeManager.Theme.Sea:
ThemeIndex = 2;
break;
case ThemeManager.Theme.Candy:
ThemeIndex = 3;
break;
case ThemeManager.Theme.Magma:
ThemeIndex = 4;
break;
}
}

private async void Apply()
{
Expand Down

0 comments on commit 92888d7

Please sign in to comment.