mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 18:11:27 -07:00
cleanup necessary namespaces and adjust namespaces for certain classes to better represent what they're for models, helpers and tools are all different and shouldnt really be under the same namespace
55 lines
1.5 KiB
C#
55 lines
1.5 KiB
C#
using System;
|
|
using System.Windows.Controls;
|
|
|
|
using Wpf.Ui.Appearance;
|
|
using Wpf.Ui.Controls.Interfaces;
|
|
using Wpf.Ui.Mvvm.Contracts;
|
|
using Wpf.Ui.Mvvm.Services;
|
|
|
|
using Bloxstrap.Extensions;
|
|
using Bloxstrap.ViewModels;
|
|
|
|
namespace Bloxstrap.Views
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for MainWindow.xaml
|
|
/// </summary>
|
|
public partial class MainWindow : INavigationWindow
|
|
{
|
|
private readonly IThemeService _themeService = new ThemeService();
|
|
private readonly IDialogService _dialogService = new DialogService();
|
|
|
|
public MainWindow()
|
|
{
|
|
App.Logger.WriteLine("[MainWindow::MainWindow] Initializing menu");
|
|
|
|
DataContext = new MainWindowViewModel(this, _dialogService);
|
|
SetTheme();
|
|
InitializeComponent();
|
|
_dialogService.SetDialogControl(RootDialog);
|
|
}
|
|
|
|
public void SetTheme()
|
|
{
|
|
_themeService.SetTheme(App.Settings.Prop.Theme.GetFinal() == Enums.Theme.Dark ? ThemeType.Dark : ThemeType.Light);
|
|
_themeService.SetSystemAccent();
|
|
}
|
|
|
|
#region INavigationWindow methods
|
|
|
|
public Frame GetFrame() => RootFrame;
|
|
|
|
public INavigation GetNavigation() => RootNavigation;
|
|
|
|
public bool Navigate(Type pageType) => RootNavigation.Navigate(pageType);
|
|
|
|
public void SetPageService(IPageService pageService) => RootNavigation.PageService = pageService;
|
|
|
|
public void ShowWindow() => Show();
|
|
|
|
public void CloseWindow() => Close();
|
|
|
|
#endregion INavigationWindow methods
|
|
}
|
|
}
|