更新主题

This commit is contained in:
Hakoyu 2023-10-28 20:38:30 +08:00
parent 2073a7d873
commit 46f4709fb7
9 changed files with 48 additions and 24 deletions

View File

@ -55,5 +55,5 @@ public class ModMakeHistory
/// 最后编辑时间 /// 最后编辑时间
/// </summary> /// </summary>
[Line(ignoreCase: true)] [Line(ignoreCase: true)]
public DateTime LastTime { get; set; } public DateTime LastTime { get; set; } = DateTime.Now;
} }

View File

@ -27,4 +27,8 @@
<Setter Property="HorizontalContentAlignment" Value="Left" /> <Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Top" /> <Setter Property="VerticalContentAlignment" Value="Top" />
</Style> </Style>
<Style x:Key="WindowXStyle" TargetType="pu:WindowX">
<Setter Property="pu:WindowXCaption.Background" Value="{DynamicResource DARKPrimary}" />
<Setter Property="pu:WindowXCaption.Foreground" Value="{DynamicResource DARKPrimaryText}" />
</Style>
</ResourceDictionary> </ResourceDictionary>

View File

@ -18,7 +18,10 @@
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBox pu:TextBoxHelper.Watermark="{ll:Str 搜索Id}" Text="{Binding Search.Value, UpdateSourceTrigger=PropertyChanged}" /> <TextBox
pu:TextBoxHelper.Watermark="{ll:Str 搜索Id}"
Style="{DynamicResource StandardTextBoxStyle}"
Text="{Binding Search.Value, UpdateSourceTrigger=PropertyChanged}" />
<DataGrid <DataGrid
Grid.Row="1" Grid.Row="1"
d:ItemsSource="{d:SampleData ItemCount=5}" d:ItemsSource="{d:SampleData ItemCount=5}"

View File

@ -18,7 +18,10 @@
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBox pu:TextBoxHelper.Watermark="{ll:Str 搜索Id}" Text="{Binding Search.Value, UpdateSourceTrigger=PropertyChanged}" /> <TextBox
pu:TextBoxHelper.Watermark="{ll:Str 搜索Id}"
Style="{DynamicResource StandardTextBoxStyle}"
Text="{Binding Search.Value, UpdateSourceTrigger=PropertyChanged}" />
<DataGrid <DataGrid
Grid.Row="1" Grid.Row="1"
d:ItemsSource="{d:SampleData ItemCount=5}" d:ItemsSource="{d:SampleData ItemCount=5}"

View File

@ -18,7 +18,10 @@
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBox pu:TextBoxHelper.Watermark="{ll:Str 搜索Id}" Text="{Binding Search.Value, UpdateSourceTrigger=PropertyChanged}" /> <TextBox
pu:TextBoxHelper.Watermark="{ll:Str 搜索Id}"
Style="{DynamicResource StandardTextBoxStyle}"
Text="{Binding Search.Value, UpdateSourceTrigger=PropertyChanged}" />
<DataGrid <DataGrid
x:Name="DataGrid_LowText" x:Name="DataGrid_LowText"
Grid.Row="1" Grid.Row="1"

View File

@ -18,7 +18,10 @@
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBox pu:TextBoxHelper.Watermark="{ll:Str 搜索Id}" Text="{Binding Search.Value, UpdateSourceTrigger=PropertyChanged}" /> <TextBox
pu:TextBoxHelper.Watermark="{ll:Str 搜索Id}"
Style="{DynamicResource StandardTextBoxStyle}"
Text="{Binding Search.Value, UpdateSourceTrigger=PropertyChanged}" />
<DataGrid <DataGrid
Grid.Row="1" Grid.Row="1"
d:ItemsSource="{d:SampleData ItemCount=5}" d:ItemsSource="{d:SampleData ItemCount=5}"

View File

@ -13,10 +13,10 @@
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<Page.Resources> <Page.Resources>
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" /> <ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
</Page.Resources> </Page.Resources>
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition />
@ -39,14 +39,14 @@
</TextBox.Style> </TextBox.Style>
</TextBox> </TextBox>
<ComboBox <ComboBox
MinWidth="150"
x:Name="ComboBox_Pet" x:Name="ComboBox_Pet"
Grid.Column="1" Grid.Column="1"
MinWidth="150"
pu:ComboBoxHelper.Watermark="{ll:Str 选择宠物}" pu:ComboBoxHelper.Watermark="{ll:Str 选择宠物}"
DisplayMemberPath="Id.Value" DisplayMemberPath="Id.Value"
ItemsSource="{Binding Pets}" ItemsSource="{Binding Pets}"
Style="{DynamicResource StandardComboBoxStyle}" SelectedItem="{Binding CurrentPet.Value}"
SelectedItem="{Binding CurrentPet.Value}"> Style="{DynamicResource StandardComboBoxStyle}">
<ComboBox.ItemContainerStyle> <ComboBox.ItemContainerStyle>
<Style BasedOn="{StaticResource {x:Type ComboBoxItem}}" TargetType="ComboBoxItem"> <Style BasedOn="{StaticResource {x:Type ComboBoxItem}}" TargetType="ComboBoxItem">
<Setter Property="ToolTip" Value="{Binding CurrentI18nData.Value.Name.Value}" /> <Setter Property="ToolTip" Value="{Binding CurrentI18nData.Value.Name.Value}" />

View File

@ -1,4 +1,4 @@
<Window <pu:WindowX
x:Class="VPet.ModMaker.Views.ModMakerWindow" x:Class="VPet.ModMaker.Views.ModMakerWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
@ -13,12 +13,13 @@
Height="450" Height="450"
d:DataContext="{d:DesignInstance Type=vm:ModMakerWindowVM}" d:DataContext="{d:DesignInstance Type=vm:ModMakerWindowVM}"
FontSize="16" FontSize="16"
Style="{DynamicResource WindowXStyle}"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<Window.Resources> <Window.Resources>
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" /> <ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
</Window.Resources> </Window.Resources>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition /> <ColumnDefinition />
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
@ -35,17 +36,21 @@
<ColumnDefinition /> <ColumnDefinition />
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBox pu:TextBoxHelper.Watermark="{ll:Str 最近的内容}" Text="{Binding HistoriesSearchText.Value}" /> <TextBox
pu:TextBoxHelper.Watermark="{ll:Str 最近的内容}"
Style="{DynamicResource StandardTextBoxStyle}"
Text="{Binding HistoriesSearchText.Value}" />
<Button <Button
Grid.Column="1" Grid.Column="1"
Command="{Binding ClearHistoriesCommand}" Command="{Binding ClearHistoriesCommand}"
Content="{ll:Str 清空历史}" /> Content="{ll:Str 清空历史}"
Style="{StaticResource ThemedButtonStyle}" />
</Grid> </Grid>
<ListBox <ListBox
Grid.Row="2" Grid.Row="2"
d:ItemsSource="{d:SampleData ItemCount=5}" d:ItemsSource="{d:SampleData ItemCount=5}"
ItemsSource="{Binding ShowHistories.Value}" ItemsSource="{Binding ShowHistories.Value}"
Style="{StaticResource SideMenuListBoxStyle}"> Style="{DynamicResource SideMenuListBoxStyle}">
<ListBox.ItemContainerStyle> <ListBox.ItemContainerStyle>
<Style BasedOn="{StaticResource {x:Type ListBoxItem}}" TargetType="ListBoxItem"> <Style BasedOn="{StaticResource {x:Type ListBoxItem}}" TargetType="ListBoxItem">
<Setter Property="Height" Value="64" /> <Setter Property="Height" Value="64" />
@ -110,12 +115,14 @@
<Button <Button
x:Name="Button_CreateNewMod" x:Name="Button_CreateNewMod"
Command="{Binding CreateNewModCommand}" Command="{Binding CreateNewModCommand}"
Content="{ll:Str 创建新的模组}" /> Content="{ll:Str 创建新的模组}"
Style="{DynamicResource ThemedButtonStyle}" />
<Button <Button
x:Name="Button_OpenFromFile" x:Name="Button_OpenFromFile"
Command="{Binding LoadModFromFileCommand}" Command="{Binding LoadModFromFileCommand}"
Content="{ll:Str 从文件中载入}" /> Content="{ll:Str 从文件中载入}"
Style="{DynamicResource ThemedButtonStyle}" />
</StackPanel> </StackPanel>
</Grid> </Grid>
</Grid> </Grid>
</Window> </pu:WindowX>

View File

@ -1,5 +1,6 @@
using LinePutScript; using LinePutScript;
using LinePutScript.Localization.WPF; using LinePutScript.Localization.WPF;
using Panuon.WPF.UI;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
@ -26,7 +27,7 @@ namespace VPet.ModMaker.Views;
/// <summary> /// <summary>
/// winModMaker.xaml 的交互逻辑 /// winModMaker.xaml 的交互逻辑
/// </summary> /// </summary>
public partial class ModMakerWindow : Window public partial class ModMakerWindow : WindowX
{ {
public ModMakerWindowVM ViewModel => (ModMakerWindowVM)DataContext; public ModMakerWindowVM ViewModel => (ModMakerWindowVM)DataContext;
public ModEditWindow ModEditWindow { get; set; } public ModEditWindow ModEditWindow { get; set; }