update ui

This commit is contained in:
辉鸭蛋 2024-10-20 10:51:41 +08:00
parent 29544507eb
commit 81b754125a
4 changed files with 100 additions and 24 deletions

View File

@ -99,15 +99,15 @@ public partial class App : Application
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>();
// 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>();

View File

@ -19,10 +19,9 @@ public partial class OneDragonTaskItem : ObservableObject
[ObservableProperty]
private OneDragonBaseViewModel? _viewModel;
public OneDragonTaskItem(OneDragonBaseViewModel viewModel)
public OneDragonTaskItem(string name)
{
_viewModel = viewModel;
Name = viewModel.Title;
Name = name;
}
public OneDragonTaskItem(Type viewModelType)

View File

@ -98,7 +98,7 @@
</DockPanel>
<!-- 右侧配置 -->
<ContentControl Grid.Column="1"
<!--<ContentControl Grid.Column="1"
Margin="20,0,0,0"
Content="{Binding SelectedTask.ViewModel}">
<ContentControl.Resources>
@ -130,6 +130,73 @@
<oneDragonView:TcgPage />
</DataTemplate>
</ContentControl.Resources>
</ContentControl>
</ContentControl>-->
<!-- 右侧配置 -->
<DockPanel Grid.Column="1" Margin="20,0,0,0">
<StackPanel Margin="0,0,0,10" DockPanel.Dock="Top">
<TextBlock Margin="0,0,0,10"
FontSize="15"
FontWeight="Bold"
Text="配置" />
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ComboBox Grid.Column="0"
ItemsSource="{Binding ConfigurationProfiles}"
SelectedItem="{Binding SelectedProfile, Mode=TwoWay}" />
<ui:Button Grid.Column="1"
Margin="10,0,0,0"
Command="{Binding SaveConfigurationCommand}"
Content="保存配置" />
</Grid>
</StackPanel>
<ScrollViewer>
<StackPanel>
<ui:Card Margin="0,0,0,10">
<StackPanel>
<TextBlock Margin="0,0,0,10"
FontWeight="Bold"
Text="合成树脂" />
<ComboBox Margin="0,0,0,10"
ItemsSource="{Binding CraftResinLocations}"
SelectedItem="{Binding SelectedCraftResinLocation, Mode=TwoWay}" />
<TextBlock Margin="0,10,0,10"
FontWeight="Bold"
Text="合成数量" />
<Slider Margin="0,0,0,10"
IsSnapToTickEnabled="True"
Maximum="5"
Minimum="0"
TickFrequency="1"
Value="{Binding CraftResinAmount, Mode=TwoWay}" />
<TextBlock Text="{Binding CraftResinAmount, StringFormat={}当前选择: {0}}" />
</StackPanel>
</ui:Card>
<ui:Card Margin="0,0,0,10">
<StackPanel>
<TextBlock Margin="0,0,0,10"
FontWeight="Bold"
Text="领取每日奖励" />
<ComboBox Margin="0,0,0,10"
ItemsSource="{Binding DailyRewardLocations}"
SelectedItem="{Binding SelectedDailyRewardLocation, Mode=TwoWay}" />
<CheckBox Margin="0,0,0,10"
Content="自动领取"
IsChecked="{Binding AutoClaimDailyReward, Mode=TwoWay}" />
</StackPanel>
</ui:Card>
<!-- 可以继续添加其他设置项 -->
</StackPanel>
</ScrollViewer>
</DockPanel>
</Grid>
</UserControl>
</UserControl>

View File

@ -14,15 +14,25 @@ public partial class OneDragonFlowViewModel : ObservableObject, INavigationAware
[ObservableProperty]
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)), // 自动七圣召唤
// 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)), // 自动七圣召唤
new OneDragonTaskItem("领取邮件"),
new OneDragonTaskItem("合成树脂"),
new OneDragonTaskItem("每日委托"),
new OneDragonTaskItem("自动秘境"),
new OneDragonTaskItem("自动锻造"),
new OneDragonTaskItem("自动刷地脉花"),
new OneDragonTaskItem("领取每日奖励"),
new OneDragonTaskItem("领取尘歌壶奖励"),
new OneDragonTaskItem("自动七圣召唤"),
];
[ObservableProperty]