mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-04-28 22:59:45 +08:00
One-stop service init
This commit is contained in:
@@ -90,6 +90,7 @@ public partial class App : Application
|
||||
services.AddView<KeyMouseRecordPage, KeyMouseRecordPageViewModel>();
|
||||
services.AddView<JsListPage, JsListViewModel>();
|
||||
services.AddView<MapPathingPage, MapPathingViewModel>();
|
||||
services.AddView<OneDragonFlowPage, OneDragonFlowViewModel>();
|
||||
|
||||
// My Services
|
||||
services.AddSingleton<TaskTriggerDispatcher>();
|
||||
|
||||
@@ -12,4 +12,8 @@
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="FaFontIconStyleForOneDragon" TargetType="ui:FontIcon">
|
||||
<Setter Property="FontFamily" Value="{StaticResource FgiIconFontFamily}" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
@@ -87,7 +87,15 @@
|
||||
<ui:SymbolIcon Symbol="Bot24" />
|
||||
</ui:NavigationViewItem.Icon>
|
||||
<ui:NavigationViewItem.MenuItems>
|
||||
|
||||
<ui:NavigationViewItem Content="一条龙"
|
||||
NavigationCacheMode="Enabled"
|
||||
TargetPageType="{x:Type pages:OneDragonFlowPage}"
|
||||
Visibility="{markup:Converter Value={x:Static helpers:RuntimeHelper.IsDebuggerAttached},
|
||||
Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:SymbolIcon Symbol="AnimalTurtle24" />
|
||||
</ui:NavigationViewItem.Icon>
|
||||
</ui:NavigationViewItem>
|
||||
<!--<ui:NavigationViewItemSeparator />-->
|
||||
<!-- ConvertRange20 -->
|
||||
<ui:NavigationViewItem Content="调度器"
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
<Page x:Class="BetterGenshinImpact.View.Pages.DispatcherPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:BetterGenshinImpact.View.Pages"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:pages="clr-namespace:BetterGenshinImpact.ViewModel.Pages"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
Title="HomePage"
|
||||
d:DataContext="{d:DesignInstance Type=pages:DispatcherPageViewModel}"
|
||||
d:DesignHeight="600"
|
||||
d:DesignWidth="800"
|
||||
ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}"
|
||||
ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
FontFamily="{StaticResource TextThemeFontFamily}"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
mc:Ignorable="d">
|
||||
<Grid Margin="42,16,42,12" />
|
||||
</Page>
|
||||
87
BetterGenshinImpact/View/Pages/OneDragonFlowPage.xaml
Normal file
87
BetterGenshinImpact/View/Pages/OneDragonFlowPage.xaml
Normal file
@@ -0,0 +1,87 @@
|
||||
<UserControl x:Class="BetterGenshinImpact.View.Pages.OneDragonFlowPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:BetterGenshinImpact.View.Pages"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:pages="clr-namespace:BetterGenshinImpact.ViewModel.Pages"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
d:DataContext="{d:DesignInstance Type=pages:OneDragonFlowViewModel}"
|
||||
d:DesignHeight="600"
|
||||
d:DesignWidth="800"
|
||||
ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}"
|
||||
ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
FontFamily="{StaticResource TextThemeFontFamily}"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
mc:Ignorable="d">
|
||||
<Grid Margin="22,16,22,12">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="2*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 左侧任务列表 -->
|
||||
<StackPanel Grid.Column="0">
|
||||
<TextBlock Margin="0,0,0,10"
|
||||
FontSize="14"
|
||||
FontWeight="Bold"
|
||||
Text="任务列表" />
|
||||
<ui:Card Margin="0,2">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:FontIcon Grid.Column="0"
|
||||
Glyph=""
|
||||
Style="{StaticResource FaFontIconStyleForOneDragon}" />
|
||||
<Ellipse Grid.Column="1"
|
||||
Width="10"
|
||||
Height="10"
|
||||
Margin="10,0,10,0"
|
||||
Fill="Red" />
|
||||
<TextBlock Grid.Column="2"
|
||||
VerticalAlignment="Center"
|
||||
Text="登录游戏" />
|
||||
<ui:ToggleSwitch Grid.Column="3" />
|
||||
</Grid>
|
||||
</ui:Card>
|
||||
<ui:Card Margin="0,2">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:FontIcon Grid.Column="0"
|
||||
Glyph=""
|
||||
Style="{StaticResource FaFontIconStyleForOneDragon}" />
|
||||
<Ellipse Grid.Column="1"
|
||||
Width="10"
|
||||
Height="10"
|
||||
Margin="10,0,10,0"
|
||||
Fill="Red" />
|
||||
<TextBlock Grid.Column="2"
|
||||
VerticalAlignment="Center"
|
||||
Text="合成树脂" />
|
||||
<ui:ToggleSwitch Grid.Column="3" />
|
||||
</Grid>
|
||||
</ui:Card>
|
||||
<!-- 添加更多任务项... -->
|
||||
<ui:Button Margin="0,20,0,0" Content="一键执行" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- 右侧配置 -->
|
||||
<StackPanel Grid.Column="1" Margin="20,0,0,0">
|
||||
<TextBlock Margin="0,0,0,10"
|
||||
FontSize="14"
|
||||
FontWeight="Bold"
|
||||
Text="登录游戏 配置" />
|
||||
<!-- 在这里添加配置项 -->
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
namespace BetterGenshinImpact.View.Pages;
|
||||
|
||||
public partial class DispatcherPage
|
||||
public partial class OneDragonFlowPage
|
||||
{
|
||||
public DispatcherPageViewModel ViewModel { get; }
|
||||
public OneDragonFlowViewModel ViewModel { get; }
|
||||
|
||||
public DispatcherPage(DispatcherPageViewModel viewModel)
|
||||
public OneDragonFlowPage(OneDragonFlowViewModel viewModel)
|
||||
{
|
||||
DataContext = ViewModel = viewModel;
|
||||
InitializeComponent();
|
||||
@@ -6,13 +6,13 @@ using Wpf.Ui.Controls;
|
||||
|
||||
namespace BetterGenshinImpact.ViewModel.Pages;
|
||||
|
||||
public partial class DispatcherPageViewModel : ObservableObject, INavigationAware, IViewModel
|
||||
public partial class OneDragonFlowViewModel : ObservableObject, INavigationAware, IViewModel
|
||||
{
|
||||
private readonly ILogger<DispatcherPageViewModel> _logger = App.GetLogger<DispatcherPageViewModel>();
|
||||
private readonly ILogger<OneDragonFlowViewModel> _logger = App.GetLogger<OneDragonFlowViewModel>();
|
||||
|
||||
private ISnackbarService _snackbarService;
|
||||
|
||||
public DispatcherPageViewModel(ISnackbarService snackbarService)
|
||||
public OneDragonFlowViewModel(ISnackbarService snackbarService)
|
||||
{
|
||||
_snackbarService = snackbarService;
|
||||
}
|
||||
@@ -24,9 +24,4 @@ public partial class DispatcherPageViewModel : ObservableObject, INavigationAwar
|
||||
public void OnNavigatedFrom()
|
||||
{
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
public void OnStartRecord()
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user