Skip to content

Commit

Permalink
Converted most things to Json
Browse files Browse the repository at this point in the history
  • Loading branch information
Soneliem committed Nov 10, 2021
1 parent 3ef62f6 commit 64de958
Show file tree
Hide file tree
Showing 42 changed files with 15,459 additions and 3,797 deletions.
13 changes: 13 additions & 0 deletions .idea/.idea.WAIUA/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/.idea.WAIUA/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/.idea.WAIUA/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions WAIUA.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31515.178
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WAIUA", "WAIUA\WAIUA.csproj", "{AF25112C-91B9-4735-AE9B-C7CE963A30A4}"
EndProject
Expand Down
2 changes: 2 additions & 0 deletions WAIUA.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RR/@EntryIndexedValue">RR</s:String></wpf:ResourceDictionary>
135 changes: 70 additions & 65 deletions WAIUA/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,82 +9,87 @@

namespace WAIUA
{
public partial class App : Application
{
private readonly NavigationStore _navigationStore;
private readonly ModalNavigationStore _modalNavigationStore;
public partial class App : Application
{
private readonly NavigationStore _navigationStore;
private readonly ModalNavigationStore _modalNavigationStore;

public App()
{
_navigationStore = new NavigationStore();
_modalNavigationStore = new ModalNavigationStore();
public App()
{
_navigationStore = new NavigationStore();
_modalNavigationStore = new ModalNavigationStore();

if (WAIUA.Properties.Settings.Default.Language.Length >= 3)
{
WAIUA.Properties.Settings.Default.Reset();
};
if (WAIUA.Properties.Settings.Default.Language.Length >= 3)
{
WAIUA.Properties.Settings.Default.Reset();
}

if (string.IsNullOrEmpty(WAIUA.Properties.Settings.Default.Language))
{
Thread.CurrentThread.CurrentCulture = CultureInfo.InstalledUICulture;
Thread.CurrentThread.CurrentUICulture = CultureInfo.InstalledUICulture;
WAIUA.Properties.Settings.Default.Language = CultureInfo.InstalledUICulture.TwoLetterISOLanguageName;
}
else
{
Thread.CurrentThread.CurrentCulture = new CultureInfo(WAIUA.Properties.Settings.Default.Language);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(WAIUA.Properties.Settings.Default.Language);
}
}
;

protected override void OnStartup(StartupEventArgs e)
{
INavigationService navigationService = CreateInfoNavigationService();
navigationService.Navigate();
if (string.IsNullOrEmpty(WAIUA.Properties.Settings.Default.Language))
{
Thread.CurrentThread.CurrentCulture = CultureInfo.InstalledUICulture;
Thread.CurrentThread.CurrentUICulture = CultureInfo.InstalledUICulture;
WAIUA.Properties.Settings.Default.Language = CultureInfo.InstalledUICulture.TwoLetterISOLanguageName;
}
else
{
Thread.CurrentThread.CurrentCulture = new CultureInfo(WAIUA.Properties.Settings.Default.Language);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(WAIUA.Properties.Settings.Default.Language);
}
}

MainWindow = new MainWindow()
{
DataContext = new MainViewModel(_navigationStore, _modalNavigationStore)
};
MainWindow.Show();
protected override void OnStartup(StartupEventArgs e)
{
INavigationService navigationService = CreateInfoNavigationService();
navigationService.Navigate();

base.OnStartup(e);
AutoUpdater.Start("https://raw.githubusercontent.com/Soneliem/WAIUA/master/WAIUA/VersionInfo.xml");
}
MainWindow = new MainWindow()
{
DataContext = new MainViewModel(_navigationStore, _modalNavigationStore)
};
MainWindow.Show();

private void Application_Exit(object sender, ExitEventArgs e)
{
WAIUA.Properties.Settings.Default.Save();
}
base.OnStartup(e);
AutoUpdater.Start("https://raw.githubusercontent.com/Soneliem/WAIUA/master/WAIUA/VersionInfo.xml");
}

private INavigationService CreateHomeNavigationService()
{
return new NavigationService<HomeViewModel>(_navigationStore, CreateHomeViewModel);
}
private void Application_Exit(object sender, ExitEventArgs e)
{
WAIUA.Properties.Settings.Default.Save();
}

private HomeViewModel CreateHomeViewModel()
{
return new HomeViewModel(CreateHomeNavigationService(), CreateInfoNavigationService(), CreateSettingsNavigationService());
}
private INavigationService CreateHomeNavigationService()
{
return new NavigationService<HomeViewModel>(_navigationStore, CreateHomeViewModel);
}

private INavigationService CreateInfoNavigationService()
{
return new NavigationService<InfoViewModel>(_navigationStore, CreateInfoViewModel);
}
private HomeViewModel CreateHomeViewModel()
{
return new HomeViewModel(CreateHomeNavigationService(), CreateInfoNavigationService(),
CreateSettingsNavigationService());
}

private InfoViewModel CreateInfoViewModel()
{
return new InfoViewModel(CreateHomeNavigationService(), CreateInfoNavigationService(), CreateSettingsNavigationService());
}
private INavigationService CreateInfoNavigationService()
{
return new NavigationService<InfoViewModel>(_navigationStore, CreateInfoViewModel);
}

private INavigationService CreateSettingsNavigationService()
{
return new NavigationService<SettingsViewModel>(_navigationStore, CreateSettingsViewModel);
}
private InfoViewModel CreateInfoViewModel()
{
return new InfoViewModel(CreateHomeNavigationService(), CreateInfoNavigationService(),
CreateSettingsNavigationService());
}

private SettingsViewModel CreateSettingsViewModel()
{
return new SettingsViewModel(CreateHomeNavigationService(), CreateInfoNavigationService(), CreateSettingsNavigationService());
}
}
private INavigationService CreateSettingsNavigationService()
{
return new NavigationService<SettingsViewModel>(_navigationStore, CreateSettingsViewModel);
}

private SettingsViewModel CreateSettingsViewModel()
{
return new SettingsViewModel(CreateHomeNavigationService(), CreateInfoNavigationService(),
CreateSettingsNavigationService());
}
}
}
12 changes: 6 additions & 6 deletions WAIUA/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System.Windows;

[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
Loading

0 comments on commit 64de958

Please sign in to comment.