mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-05-29 10:25:50 +08:00
44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
using BetterGenshinImpact.Helpers.DpiAwareness;
|
|
using BetterGenshinImpact.ViewModel;
|
|
using System;
|
|
using Wpf.Ui;
|
|
using Wpf.Ui.Controls;
|
|
|
|
namespace BetterGenshinImpact.View;
|
|
|
|
/// <summary>
|
|
/// Interaction logic for MainWindow.xaml
|
|
/// </summary>
|
|
public partial class MainWindow : INavigationWindow
|
|
{
|
|
public MainWindowViewModel ViewModel { get; }
|
|
|
|
public MainWindow(MainWindowViewModel viewModel, IPageService pageService, INavigationService navigationService)
|
|
{
|
|
DataContext = ViewModel = viewModel;
|
|
|
|
InitializeComponent();
|
|
this.InitializeDpiAwareness();
|
|
|
|
SetPageService(pageService);
|
|
navigationService.SetNavigationControl(RootNavigation);
|
|
}
|
|
|
|
public INavigationView GetNavigation() => RootNavigation;
|
|
|
|
public bool Navigate(Type pageType) => RootNavigation.Navigate(pageType);
|
|
|
|
public void SetServiceProvider(IServiceProvider serviceProvider)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public void SetPageService(IPageService pageService)
|
|
{
|
|
RootNavigation.SetPageService(pageService);
|
|
}
|
|
|
|
public void ShowWindow() => Show();
|
|
|
|
public void CloseWindow() => Close();
|
|
} |