mirror of
https://github.com/babalae/better-genshin-impact
synced 2025-01-09 04:19:47 +08:00
one dragon: fill
添加 OneDragon 相关 ViewModel 和页面,删除旧配置 在 `App.xaml.cs` 中添加了 `using BetterGenshinImpact.ViewModel.Pages.OneDragon` 语句,并在 `App` 类中添加了一系列 `OneDragon` 相关的 ViewModel 到服务集合中。 在 `OneDragonTaskItem.cs` 中调整了 `using` 语句的顺序,初始化了一些属性的默认值,并添加了两个构造函数。 删除了 `LoginConfigPage.xaml`、`LoginConfigPage.xaml.cs`、`MailConfigPage.xaml`、`MailConfigPage.xaml.cs`、`LoginConfigViewModel.cs` 和 `MailConfigViewModel.cs` 文件的内容。 在 `OneDragonFlowPage.xaml` 中更新了 `oneDragonView` 的命名空间,并添加了多个 `DataTemplate` 以支持新的 ViewModel。 在 `OneDragonFlowViewModel.cs` 中调整了 `using` 语句的顺序,并更新了 `_taskList` 的初始化内容。 添加了多个新的 ViewModel 文件,包括 `CraftViewModel.cs`、`DailyCommissionViewModel.cs`、`DailyRewardViewModel.cs`、`DomainViewModel.cs`、`ForgingViewModel.cs`、`LeyLineBlossomViewModel.cs`、`MailViewModel.cs`、`OneDragonBaseViewModel.cs`、`SereniteaPotViewModel.cs` 和 `TcgViewModel.cs`。 添加了多个新的页面文件,包括 `CraftPage.xaml`、`CraftPage.xaml.cs`、`DailyCommissionPage.xaml`、`DailyCommissionPage.xaml.cs`、`DailyRewardPage.xaml`、`DailyRewardPage.xaml.cs`、`DomainPage.xaml`、`DomainPage.xaml.cs`、`ForgingPage.xaml`、`ForgingPage.xaml.cs`、`LeyLineBlossomPage.xaml`、`LeyLineBlossomPage.xaml.cs`、`MailPage.xaml`、`MailPage.xaml.cs`、`SereniteaPotPage.xaml`、`SereniteaPotPage.xaml.cs` 和 `TcgPage.xaml`、`TcgPage.xaml.cs`。
This commit is contained in:
parent
8471d5ef88
commit
29544507eb
@ -22,6 +22,7 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using BetterGenshinImpact.ViewModel.Pages.OneDragon;
|
||||
using Wpf.Ui;
|
||||
using Wpf.Ui.Violeta.Controls;
|
||||
|
||||
@ -97,6 +98,17 @@ public partial class App : Application
|
||||
services.AddView<MapPathingPage, MapPathingViewModel>();
|
||||
services.AddView<OneDragonFlowPage, OneDragonFlowViewModel>();
|
||||
|
||||
// 一条龙 ViewModels
|
||||
services.AddSingleton<CraftViewModel>();
|
||||
services.AddSingleton<DailyCommissionViewModel>();
|
||||
services.AddSingleton<DailyRewardViewModel>();
|
||||
services.AddSingleton<DomainViewModel>();
|
||||
services.AddSingleton<ForgingViewModel>();
|
||||
services.AddSingleton<LeyLineBlossomViewModel>();
|
||||
services.AddSingleton<MailViewModel>();
|
||||
services.AddSingleton<SereniteaPotViewModel>();
|
||||
services.AddSingleton<TcgViewModel>();
|
||||
|
||||
// My Services
|
||||
services.AddSingleton<TaskTriggerDispatcher>();
|
||||
services.AddSingleton<NotificationService>();
|
||||
|
@ -1,6 +1,7 @@
|
||||
using System.Windows.Media;
|
||||
using BetterGenshinImpact.ViewModel;
|
||||
using System;
|
||||
using BetterGenshinImpact.ViewModel.Pages.OneDragon;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace BetterGenshinImpact.Model;
|
||||
|
||||
@ -10,11 +11,27 @@ public partial class OneDragonTaskItem : ObservableObject
|
||||
private string? _name;
|
||||
|
||||
[ObservableProperty]
|
||||
private Brush? _statusColor;
|
||||
private Brush _statusColor = Brushes.Gray;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _isEnabled;
|
||||
private bool _isEnabled = true;
|
||||
|
||||
[ObservableProperty]
|
||||
private IViewModel? _viewModel;
|
||||
private OneDragonBaseViewModel? _viewModel;
|
||||
|
||||
public OneDragonTaskItem(OneDragonBaseViewModel viewModel)
|
||||
{
|
||||
_viewModel = viewModel;
|
||||
Name = viewModel.Title;
|
||||
}
|
||||
|
||||
public OneDragonTaskItem(Type viewModelType)
|
||||
{
|
||||
ViewModel = App.GetService(viewModelType) as OneDragonBaseViewModel;
|
||||
if (ViewModel == null)
|
||||
{
|
||||
throw new ArgumentException("Invalid view model type", nameof(viewModelType));
|
||||
}
|
||||
Name = ViewModel.Title;
|
||||
}
|
||||
}
|
||||
|
20
BetterGenshinImpact/View/Pages/OneDragon/CraftPage.xaml
Normal file
20
BetterGenshinImpact/View/Pages/OneDragon/CraftPage.xaml
Normal file
@ -0,0 +1,20 @@
|
||||
<UserControl x:Class="BetterGenshinImpact.View.Pages.OneDragon.CraftPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:oneDragon="clr-namespace:BetterGenshinImpact.ViewModel.Pages.OneDragon"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
d:DataContext="{d:DesignInstance Type=oneDragon:CraftViewModel}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel>
|
||||
<TextBlock Margin="0,0,0,10"
|
||||
FontSize="15"
|
||||
FontWeight="Bold"
|
||||
Text="{Binding Title}" />
|
||||
|
||||
<!-- 在这里添加CraftViewModel特定的控件 -->
|
||||
</StackPanel>
|
||||
</UserControl>
|
14
BetterGenshinImpact/View/Pages/OneDragon/CraftPage.xaml.cs
Normal file
14
BetterGenshinImpact/View/Pages/OneDragon/CraftPage.xaml.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace BetterGenshinImpact.View.Pages.OneDragon;
|
||||
|
||||
/// <summary>
|
||||
/// CraftPage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class CraftPage : UserControl
|
||||
{
|
||||
public CraftPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
<UserControl x:Class="BetterGenshinImpact.View.Pages.OneDragon.DailyCommissionPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:oneDragon="clr-namespace:BetterGenshinImpact.ViewModel.Pages.OneDragon"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
d:DataContext="{d:DesignInstance Type=oneDragon:DailyCommissionViewModel}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel>
|
||||
<TextBlock Margin="0,0,0,10"
|
||||
FontSize="15"
|
||||
FontWeight="Bold"
|
||||
Text="{Binding Title}" />
|
||||
|
||||
<!-- 在这里添加DailyCommissionViewModel特定的控件 -->
|
||||
</StackPanel>
|
||||
</UserControl>
|
@ -0,0 +1,14 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace BetterGenshinImpact.View.Pages.OneDragon;
|
||||
|
||||
/// <summary>
|
||||
/// DailyCommissionPage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DailyCommissionPage : UserControl
|
||||
{
|
||||
public DailyCommissionPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
<UserControl x:Class="BetterGenshinImpact.View.Pages.OneDragon.DailyRewardPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:oneDragon="clr-namespace:BetterGenshinImpact.ViewModel.Pages.OneDragon"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
d:DataContext="{d:DesignInstance Type=oneDragon:DailyRewardViewModel}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel>
|
||||
<TextBlock Margin="0,0,0,10"
|
||||
FontSize="15"
|
||||
FontWeight="Bold"
|
||||
Text="{Binding Title}" />
|
||||
|
||||
<!-- 在这里添加DailyRewardViewModel特定的控件 -->
|
||||
</StackPanel>
|
||||
</UserControl>
|
@ -0,0 +1,14 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace BetterGenshinImpact.View.Pages.OneDragon;
|
||||
|
||||
/// <summary>
|
||||
/// DailyRewardPage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DailyRewardPage : UserControl
|
||||
{
|
||||
public DailyRewardPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
20
BetterGenshinImpact/View/Pages/OneDragon/DomainPage.xaml
Normal file
20
BetterGenshinImpact/View/Pages/OneDragon/DomainPage.xaml
Normal file
@ -0,0 +1,20 @@
|
||||
<UserControl x:Class="BetterGenshinImpact.View.Pages.OneDragon.DomainPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:oneDragon="clr-namespace:BetterGenshinImpact.ViewModel.Pages.OneDragon"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
d:DataContext="{d:DesignInstance Type=oneDragon:DomainViewModel}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel>
|
||||
<TextBlock Margin="0,0,0,10"
|
||||
FontSize="15"
|
||||
FontWeight="Bold"
|
||||
Text="{Binding Title}" />
|
||||
|
||||
<!-- 在这里添加DomainViewModel特定的控件 -->
|
||||
</StackPanel>
|
||||
</UserControl>
|
14
BetterGenshinImpact/View/Pages/OneDragon/DomainPage.xaml.cs
Normal file
14
BetterGenshinImpact/View/Pages/OneDragon/DomainPage.xaml.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace BetterGenshinImpact.View.Pages.OneDragon;
|
||||
|
||||
/// <summary>
|
||||
/// DomainPage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DomainPage : UserControl
|
||||
{
|
||||
public DomainPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
20
BetterGenshinImpact/View/Pages/OneDragon/ForgingPage.xaml
Normal file
20
BetterGenshinImpact/View/Pages/OneDragon/ForgingPage.xaml
Normal file
@ -0,0 +1,20 @@
|
||||
<UserControl x:Class="BetterGenshinImpact.View.Pages.OneDragon.ForgingPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:oneDragon="clr-namespace:BetterGenshinImpact.ViewModel.Pages.OneDragon"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
d:DataContext="{d:DesignInstance Type=oneDragon:ForgingViewModel}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel>
|
||||
<TextBlock Margin="0,0,0,10"
|
||||
FontSize="15"
|
||||
FontWeight="Bold"
|
||||
Text="{Binding Title}" />
|
||||
|
||||
<!-- 在这里添加ForgingViewModel特定的控件 -->
|
||||
</StackPanel>
|
||||
</UserControl>
|
14
BetterGenshinImpact/View/Pages/OneDragon/ForgingPage.xaml.cs
Normal file
14
BetterGenshinImpact/View/Pages/OneDragon/ForgingPage.xaml.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace BetterGenshinImpact.View.Pages.OneDragon;
|
||||
|
||||
/// <summary>
|
||||
/// ForgingPage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ForgingPage : UserControl
|
||||
{
|
||||
public ForgingPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
<UserControl x:Class="BetterGenshinImpact.View.Pages.OneDragon.LeyLineBlossomPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:oneDragon="clr-namespace:BetterGenshinImpact.ViewModel.Pages.OneDragon"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
d:DataContext="{d:DesignInstance Type=oneDragon:LeyLineBlossomViewModel}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel>
|
||||
<TextBlock Margin="0,0,0,10"
|
||||
FontSize="15"
|
||||
FontWeight="Bold"
|
||||
Text="{Binding Title}" />
|
||||
|
||||
<!-- 在这里添加LeyLineBlossomViewModel特定的控件 -->
|
||||
</StackPanel>
|
||||
</UserControl>
|
@ -0,0 +1,14 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace BetterGenshinImpact.View.Pages.OneDragon;
|
||||
|
||||
/// <summary>
|
||||
/// LeyLineBlossomPage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class LeyLineBlossomPage : UserControl
|
||||
{
|
||||
public LeyLineBlossomPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
<UserControl x:Class="View.Pages.OneDragon.LoginConfigPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:View.Pages.OneDragon"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel>
|
||||
<TextBlock Margin="0,0,0,10"
|
||||
FontSize="18"
|
||||
FontWeight="Bold"
|
||||
Text="登录游戏配置" />
|
||||
|
||||
<ui:TextBox Margin="0,0,0,10"
|
||||
PlaceholderText="用户名"
|
||||
Text="{Binding Username, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
<ui:PasswordBox Margin="0,0,0,10"
|
||||
Password="{Binding Password, UpdateSourceTrigger=PropertyChanged}"
|
||||
PlaceholderText="密码" />
|
||||
|
||||
<ui:ToggleSwitch Margin="0,0,0,10"
|
||||
Content="记住密码"
|
||||
IsChecked="{Binding RememberPassword}" />
|
||||
|
||||
<ui:Button HorizontalAlignment="Left"
|
||||
Command="{Binding SaveConfigCommand}"
|
||||
Content="保存配置" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
@ -1,26 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace View.Pages.OneDragon
|
||||
{
|
||||
/// <summary>
|
||||
/// LoginConfigPage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class LoginConfigPage : UserControl
|
||||
{
|
||||
public LoginConfigPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace View.Pages.OneDragon
|
||||
{
|
||||
/// <summary>
|
||||
/// MailConfigPage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class MailConfigPage : UserControl
|
||||
{
|
||||
public MailConfigPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,10 +1,11 @@
|
||||
<UserControl x:Class="View.Pages.OneDragon.MailConfigPage"
|
||||
<UserControl x:Class="BetterGenshinImpact.View.Pages.OneDragon.MailPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:View.Pages.OneDragon"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:oneDragon="clr-namespace:BetterGenshinImpact.ViewModel.Pages.OneDragon"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
d:DataContext="{d:DesignInstance Type=oneDragon:MailViewModel}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
@ -12,7 +13,7 @@
|
||||
<TextBlock Margin="0,0,0,10"
|
||||
FontSize="15"
|
||||
FontWeight="Bold"
|
||||
Text="领取邮件配置" />
|
||||
Text="{Binding Title}" />
|
||||
|
||||
<ui:ToggleSwitch Margin="0,0,0,10"
|
||||
Content="领取所有邮件"
|
||||
@ -27,9 +28,5 @@
|
||||
Minimum="1"
|
||||
PlaceholderText="最大领取邮件数量"
|
||||
Value="{Binding MaxMailsToCollect}" />
|
||||
|
||||
<ui:Button HorizontalAlignment="Left"
|
||||
Command="{Binding SaveConfigCommand}"
|
||||
Content="保存配置" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
14
BetterGenshinImpact/View/Pages/OneDragon/MailPage.xaml.cs
Normal file
14
BetterGenshinImpact/View/Pages/OneDragon/MailPage.xaml.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace BetterGenshinImpact.View.Pages.OneDragon;
|
||||
|
||||
/// <summary>
|
||||
/// MailConfigPage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class MailPage : UserControl
|
||||
{
|
||||
public MailPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
<UserControl x:Class="BetterGenshinImpact.View.Pages.OneDragon.SereniteaPotPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:oneDragon="clr-namespace:BetterGenshinImpact.ViewModel.Pages.OneDragon"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
d:DataContext="{d:DesignInstance Type=oneDragon:SereniteaPotViewModel}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel>
|
||||
<TextBlock Margin="0,0,0,10"
|
||||
FontSize="15"
|
||||
FontWeight="Bold"
|
||||
Text="{Binding Title}" />
|
||||
|
||||
<!-- 在这里添加SereniteaPotViewModel特定的控件 -->
|
||||
</StackPanel>
|
||||
</UserControl>
|
@ -0,0 +1,14 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace BetterGenshinImpact.View.Pages.OneDragon;
|
||||
|
||||
/// <summary>
|
||||
/// SereniteaPotPage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SereniteaPotPage : UserControl
|
||||
{
|
||||
public SereniteaPotPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
20
BetterGenshinImpact/View/Pages/OneDragon/TcgPage.xaml
Normal file
20
BetterGenshinImpact/View/Pages/OneDragon/TcgPage.xaml
Normal file
@ -0,0 +1,20 @@
|
||||
<UserControl x:Class="BetterGenshinImpact.View.Pages.OneDragon.TcgPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:oneDragon="clr-namespace:BetterGenshinImpact.ViewModel.Pages.OneDragon"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
d:DataContext="{d:DesignInstance Type=oneDragon:TcgViewModel}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel>
|
||||
<TextBlock Margin="0,0,0,10"
|
||||
FontSize="15"
|
||||
FontWeight="Bold"
|
||||
Text="{Binding Title}" />
|
||||
|
||||
<!-- 在这里添加TcgViewModel特定的控件 -->
|
||||
</StackPanel>
|
||||
</UserControl>
|
14
BetterGenshinImpact/View/Pages/OneDragon/TcgPage.xaml.cs
Normal file
14
BetterGenshinImpact/View/Pages/OneDragon/TcgPage.xaml.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace BetterGenshinImpact.View.Pages.OneDragon;
|
||||
|
||||
/// <summary>
|
||||
/// TcgPage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class TcgPage : UserControl
|
||||
{
|
||||
public TcgPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@
|
||||
xmlns:local="clr-namespace:BetterGenshinImpact.View.Pages"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:oneDragon="clr-namespace:BetterGenshinImpact.ViewModel.Pages.OneDragon"
|
||||
xmlns:oneDragonView="clr-namespace:View.Pages.OneDragon"
|
||||
xmlns:oneDragonView="clr-namespace:BetterGenshinImpact.View.Pages.OneDragon"
|
||||
xmlns:pages="clr-namespace:BetterGenshinImpact.ViewModel.Pages"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
d:DataContext="{d:DesignInstance Type=pages:OneDragonFlowViewModel}"
|
||||
@ -102,13 +102,33 @@
|
||||
Margin="20,0,0,0"
|
||||
Content="{Binding SelectedTask.ViewModel}">
|
||||
<ContentControl.Resources>
|
||||
<DataTemplate DataType="{x:Type oneDragon:LoginConfigViewModel}">
|
||||
<oneDragonView:LoginConfigPage />
|
||||
<DataTemplate DataType="{x:Type oneDragon:MailViewModel}">
|
||||
<oneDragonView:MailPage />
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type oneDragon:MailConfigViewModel}">
|
||||
<oneDragonView:MailConfigPage />
|
||||
<DataTemplate DataType="{x:Type oneDragon:CraftViewModel}">
|
||||
<oneDragonView:CraftPage />
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type oneDragon:DailyCommissionViewModel}">
|
||||
<oneDragonView:DailyCommissionPage />
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type oneDragon:DailyRewardViewModel}">
|
||||
<oneDragonView:DailyRewardPage />
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type oneDragon:DomainViewModel}">
|
||||
<oneDragonView:DomainPage />
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type oneDragon:ForgingViewModel}">
|
||||
<oneDragonView:ForgingPage />
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type oneDragon:LeyLineBlossomViewModel}">
|
||||
<oneDragonView:LeyLineBlossomPage />
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type oneDragon:SereniteaPotViewModel}">
|
||||
<oneDragonView:SereniteaPotPage />
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type oneDragon:TcgViewModel}">
|
||||
<oneDragonView:TcgPage />
|
||||
</DataTemplate>
|
||||
<!-- 为其他任务类型添加相应的DataTemplate -->
|
||||
</ContentControl.Resources>
|
||||
</ContentControl>
|
||||
</Grid>
|
||||
|
@ -0,0 +1,8 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace BetterGenshinImpact.ViewModel.Pages.OneDragon;
|
||||
|
||||
public partial class CraftViewModel : OneDragonBaseViewModel
|
||||
{
|
||||
public override string Title { get; } = "合成浓缩树脂";
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace BetterGenshinImpact.ViewModel.Pages.OneDragon;
|
||||
|
||||
public partial class DailyCommissionViewModel : OneDragonBaseViewModel
|
||||
{
|
||||
public override string Title { get; } = "每日委托";
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace BetterGenshinImpact.ViewModel.Pages.OneDragon;
|
||||
|
||||
public partial class DailyRewardViewModel : OneDragonBaseViewModel
|
||||
{
|
||||
public override string Title { get; } = "领取每日奖励";
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace BetterGenshinImpact.ViewModel.Pages.OneDragon;
|
||||
|
||||
public partial class DomainViewModel : OneDragonBaseViewModel
|
||||
{
|
||||
public override string Title { get; } = "刷秘境";
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace BetterGenshinImpact.ViewModel.Pages.OneDragon;
|
||||
|
||||
public partial class ForgingViewModel : OneDragonBaseViewModel
|
||||
{
|
||||
public override string Title { get; } = "合成浓缩树脂";
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace BetterGenshinImpact.ViewModel.Pages.OneDragon;
|
||||
|
||||
public partial class LeyLineBlossomViewModel : OneDragonBaseViewModel
|
||||
{
|
||||
public override string Title { get; } = "刷地脉花";
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Wpf.Ui.Controls;
|
||||
|
||||
namespace BetterGenshinImpact.ViewModel.Pages.OneDragon;
|
||||
|
||||
public partial class LoginConfigViewModel : ObservableObject, IViewModel
|
||||
{
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace BetterGenshinImpact.ViewModel.Pages.OneDragon;
|
||||
|
||||
public partial class MailConfigViewModel : ObservableObject, IViewModel
|
||||
{
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace BetterGenshinImpact.ViewModel.Pages.OneDragon;
|
||||
|
||||
public partial class MailViewModel : OneDragonBaseViewModel
|
||||
{
|
||||
public override string Title { get; } = "领取邮件";
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace BetterGenshinImpact.ViewModel.Pages.OneDragon;
|
||||
|
||||
public abstract partial class OneDragonBaseViewModel : ObservableObject, IViewModel
|
||||
{
|
||||
public abstract string Title { get; }
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace BetterGenshinImpact.ViewModel.Pages.OneDragon;
|
||||
|
||||
public partial class SereniteaPotViewModel : OneDragonBaseViewModel
|
||||
{
|
||||
public override string Title { get; } = "领取尘歌壶奖励";
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace BetterGenshinImpact.ViewModel.Pages.OneDragon;
|
||||
|
||||
public partial class TcgViewModel : OneDragonBaseViewModel
|
||||
{
|
||||
public override string Title { get; } = "自动七圣召唤";
|
||||
}
|
@ -1,11 +1,8 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using BetterGenshinImpact.Model;
|
||||
using BetterGenshinImpact.ViewModel.Pages.OneDragon;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows.Media;
|
||||
using BetterGenshinImpact.Model;
|
||||
using BetterGenshinImpact.ViewModel.Pages.OneDragon;
|
||||
using Wpf.Ui;
|
||||
using Wpf.Ui.Controls;
|
||||
|
||||
namespace BetterGenshinImpact.ViewModel.Pages;
|
||||
@ -15,13 +12,21 @@ public partial class OneDragonFlowViewModel : ObservableObject, INavigationAware
|
||||
private readonly ILogger<OneDragonFlowViewModel> _logger = App.GetLogger<OneDragonFlowViewModel>();
|
||||
|
||||
[ObservableProperty]
|
||||
private ObservableCollection<OneDragonTaskItem> _taskList = [
|
||||
new OneDragonTaskItem { Name = "登录游戏", StatusColor = Brushes.Gray, IsEnabled = true, ViewModel = new LoginConfigViewModel()},
|
||||
new OneDragonTaskItem { Name = "合成树脂", StatusColor = Brushes.Gray, IsEnabled = true, ViewModel = new MailConfigViewModel()},
|
||||
private ObservableCollection<OneDragonTaskItem> _taskList =
|
||||
[
|
||||
new OneDragonTaskItem(typeof(MailViewModel)), //领取邮件
|
||||
new OneDragonTaskItem(typeof(CraftViewModel)), // 合成树脂
|
||||
new OneDragonTaskItem(typeof(DailyCommissionViewModel)), // 每日委托
|
||||
new OneDragonTaskItem(typeof(DomainViewModel)), // 自动秘境
|
||||
new OneDragonTaskItem(typeof(ForgingViewModel)), // 自动锻造
|
||||
new OneDragonTaskItem(typeof(LeyLineBlossomViewModel)), // 自动刷地脉花
|
||||
new OneDragonTaskItem(typeof(DailyRewardViewModel)), // 领取每日奖励
|
||||
new OneDragonTaskItem(typeof(SereniteaPotViewModel)), // 领取尘歌壶奖励
|
||||
new OneDragonTaskItem(typeof(TcgViewModel)), // 自动七圣召唤
|
||||
];
|
||||
|
||||
[ObservableProperty]
|
||||
private OneDragonTaskItem _selectedTask;
|
||||
private OneDragonTaskItem? _selectedTask;
|
||||
|
||||
public void OnNavigatedTo()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user