支持桌宠风格化

This commit is contained in:
ZouJin 2023-10-27 17:20:24 +08:00
parent 2316a86824
commit 910ea18505
20 changed files with 398 additions and 390 deletions

Binary file not shown.

Binary file not shown.

View File

@ -14,6 +14,9 @@
d:DataContext="{d:DesignInstance Type=vm:AddCultureWindowVM}" d:DataContext="{d:DesignInstance Type=vm:AddCultureWindowVM}"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<Window.Resources>
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
</Window.Resources>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition /> <ColumnDefinition />

View File

@ -15,24 +15,22 @@
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<Window.Resources> <Window.Resources>
<Style <ResourceDictionary>
x:Key="ListBoxItem_Style" <ResourceDictionary.MergedDictionaries>
BasedOn="{StaticResource {x:Type ListBoxItem}}" <ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
TargetType="ListBoxItem"> </ResourceDictionary.MergedDictionaries>
<Style x:Key="ListBoxItem_Style" BasedOn="{StaticResource {x:Type ListBoxItem}}" TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> <Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" /> <Setter Property="VerticalContentAlignment" Value="Stretch" />
</Style> </Style>
<DataTemplate x:Key="Expander_AnimeItem" DataType="Expander"> <DataTemplate x:Key="Expander_AnimeItem" DataType="Expander">
<Expander <Expander HorizontalAlignment="Stretch" VerticalAlignment="Top" d:DataContext="">
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
d:DataContext="">
<Expander.Header> <Expander.Header>
<Grid Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"> <Grid
Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}">
<Grid.ContextMenu> <Grid.ContextMenu>
<ContextMenu d:DataContext=""> <ContextMenu d:DataContext="">
<MenuItem <MenuItem d:Header="添加图片"
d:Header="添加图片"
Command="{Binding PlacementTarget.Tag.RemoveAnimeCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" Command="{Binding PlacementTarget.Tag.RemoveAnimeCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 删除此动画}" Header="{ll:Str 删除此动画}"
@ -45,7 +43,8 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Margin="10,0,10,0"> <TextBlock Margin="10,0,10,0">
<TextBlock.Text> <TextBlock.Text>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="{}({0}, {1}, {2})"> <MultiBinding Converter="{StaticResource StringFormatConverter}"
ConverterParameter="{}({0}, {1}, {2})">
<Binding Path="FrontImages.Count" /> <Binding Path="FrontImages.Count" />
<Binding Path="BackImages.Count" /> <Binding Path="BackImages.Count" />
<Binding Path="FoodLocations.Count" /> <Binding Path="FoodLocations.Count" />
@ -67,17 +66,16 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<GroupBox> <GroupBox>
<GroupBox.Header> <GroupBox.Header>
<StackPanel Orientation="Horizontal" Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"> <StackPanel Orientation="Horizontal"
Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}">
<StackPanel.ContextMenu> <StackPanel.ContextMenu>
<ContextMenu d:DataContext=""> <ContextMenu d:DataContext="">
<MenuItem <MenuItem d:Header="添加图片"
d:Header="添加图片"
Command="{Binding PlacementTarget.Tag.AddFrontImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" Command="{Binding PlacementTarget.Tag.AddFrontImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 添加图片}" Header="{ll:Str 添加图片}"
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" /> IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
<MenuItem <MenuItem d:Header="添加图片"
d:Header="添加图片"
Command="{Binding PlacementTarget.Tag.ClearFrontImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" Command="{Binding PlacementTarget.Tag.ClearFrontImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 清空图片}" Header="{ll:Str 清空图片}"
@ -87,18 +85,16 @@
<Label d:Content="顶层图片" Content="{ll:Str 顶层图片}" /> <Label d:Content="顶层图片" Content="{ll:Str 顶层图片}" />
<TextBlock Margin="10,0,0,0"> <TextBlock Margin="10,0,0,0">
<TextBlock.Text> <TextBlock.Text>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="{}({0})"> <MultiBinding Converter="{StaticResource StringFormatConverter}"
ConverterParameter="{}({0})">
<Binding Path="FrontImages.Count" /> <Binding Path="FrontImages.Count" />
</MultiBinding> </MultiBinding>
</TextBlock.Text> </TextBlock.Text>
</TextBlock> </TextBlock>
</StackPanel> </StackPanel>
</GroupBox.Header> </GroupBox.Header>
<ListBox <ListBox x:Name="ListBox_FrontImages" d:ItemsSource="{d:SampleData ItemCount=5}"
x:Name="ListBox_FrontImages" AllowDrop="True" Drop="ListBox_Drop"
d:ItemsSource="{d:SampleData ItemCount=5}"
AllowDrop="True"
Drop="ListBox_Drop"
ItemsSource="{Binding FrontImages, IsAsync=True}" ItemsSource="{Binding FrontImages, IsAsync=True}"
PreviewMouseMove="ListBox_PreviewMouseMove" PreviewMouseMove="ListBox_PreviewMouseMove"
ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto"
@ -112,17 +108,17 @@
</ListBox.ItemsPanel> </ListBox.ItemsPanel>
<ListBox.ItemTemplate> <ListBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Expander, Mode=FindAncestor}}" Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"> <Grid
DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Expander, Mode=FindAncestor}}"
Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}">
<Grid.ContextMenu> <Grid.ContextMenu>
<ContextMenu> <ContextMenu>
<MenuItem <MenuItem d:Header="修改图片"
d:Header="修改图片"
Command="{Binding PlacementTarget.Tag.ChangeFrontImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" Command="{Binding PlacementTarget.Tag.ChangeFrontImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 修改图片}" Header="{ll:Str 修改图片}"
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" /> IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
<MenuItem <MenuItem d:Header="删除图片"
d:Header="删除图片"
Command="{Binding PlacementTarget.Tag.RemoveFrontImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" Command="{Binding PlacementTarget.Tag.RemoveFrontImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 删除图片}" Header="{ll:Str 删除图片}"
@ -133,16 +129,11 @@
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Image <Image Width="150" Height="150" d:DataContext=""
Width="150"
Height="150"
d:DataContext=""
DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}" DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}"
Source="{Binding Image.Value, IsAsync=True}"> Source="{Binding Image.Value, IsAsync=True}">
<Image.ToolTip> <Image.ToolTip>
<Image <Image Width="250" Height="250"
Width="250"
Height="250"
Source="{Binding Image.Value, IsAsync=True}" /> Source="{Binding Image.Value, IsAsync=True}" />
</Image.ToolTip> </Image.ToolTip>
</Image> </Image>
@ -152,7 +143,8 @@
<ColumnDefinition /> <ColumnDefinition />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Label d:Content="持续时间(ms)" Content="{ll:Str 持续时间(ms)}" /> <Label d:Content="持续时间(ms)" Content="{ll:Str 持续时间(ms)}" />
<pu:NumberInput Grid.Column="1" Value="{Binding DataContext.Duration.Value, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}" /> <pu:NumberInput Grid.Column="1"
Value="{Binding DataContext.Duration.Value, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}" />
</Grid> </Grid>
</Grid> </Grid>
</DataTemplate> </DataTemplate>
@ -161,17 +153,16 @@
</GroupBox> </GroupBox>
<GroupBox Grid.Row="1"> <GroupBox Grid.Row="1">
<GroupBox.Header> <GroupBox.Header>
<StackPanel Orientation="Horizontal" Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"> <StackPanel Orientation="Horizontal"
Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}">
<StackPanel.ContextMenu> <StackPanel.ContextMenu>
<ContextMenu d:DataContext=""> <ContextMenu d:DataContext="">
<MenuItem <MenuItem d:Header="添加图片"
d:Header="添加图片"
Command="{Binding PlacementTarget.Tag.AddBackImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" Command="{Binding PlacementTarget.Tag.AddBackImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 添加图片}" Header="{ll:Str 添加图片}"
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" /> IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
<MenuItem <MenuItem d:Header="添加图片"
d:Header="添加图片"
Command="{Binding PlacementTarget.Tag.ClearBackImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" Command="{Binding PlacementTarget.Tag.ClearBackImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 清空图片}" Header="{ll:Str 清空图片}"
@ -181,18 +172,16 @@
<Label d:Content="底层图片" Content="{ll:Str 底层图片}" /> <Label d:Content="底层图片" Content="{ll:Str 底层图片}" />
<TextBlock Margin="10,0,0,0"> <TextBlock Margin="10,0,0,0">
<TextBlock.Text> <TextBlock.Text>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="{}({0})"> <MultiBinding Converter="{StaticResource StringFormatConverter}"
ConverterParameter="{}({0})">
<Binding Path="BackImages.Count" /> <Binding Path="BackImages.Count" />
</MultiBinding> </MultiBinding>
</TextBlock.Text> </TextBlock.Text>
</TextBlock> </TextBlock>
</StackPanel> </StackPanel>
</GroupBox.Header> </GroupBox.Header>
<ListBox <ListBox x:Name="ListBox_BackImages" d:ItemsSource="{d:SampleData ItemCount=5}"
x:Name="ListBox_BackImages" AllowDrop="True" Drop="ListBox_Drop"
d:ItemsSource="{d:SampleData ItemCount=5}"
AllowDrop="True"
Drop="ListBox_Drop"
ItemsSource="{Binding BackImages, IsAsync=True}" ItemsSource="{Binding BackImages, IsAsync=True}"
PreviewMouseMove="ListBox_PreviewMouseMove" PreviewMouseMove="ListBox_PreviewMouseMove"
ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto"
@ -206,17 +195,17 @@
</ListBox.ItemsPanel> </ListBox.ItemsPanel>
<ListBox.ItemTemplate> <ListBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Expander, Mode=FindAncestor}}" Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"> <Grid
DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Expander, Mode=FindAncestor}}"
Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}">
<Grid.ContextMenu> <Grid.ContextMenu>
<ContextMenu> <ContextMenu>
<MenuItem <MenuItem d:Header="修改图片"
d:Header="修改图片"
Command="{Binding PlacementTarget.Tag.ChangeBackImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" Command="{Binding PlacementTarget.Tag.ChangeBackImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 修改图片}" Header="{ll:Str 修改图片}"
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" /> IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
<MenuItem <MenuItem d:Header="删除图片"
d:Header="删除图片"
Command="{Binding PlacementTarget.Tag.RemoveBackImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" Command="{Binding PlacementTarget.Tag.RemoveBackImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 删除图片}" Header="{ll:Str 删除图片}"
@ -227,16 +216,11 @@
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Image <Image Width="150" Height="150" d:DataContext=""
Width="150"
Height="150"
d:DataContext=""
DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}" DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}"
Source="{Binding Image.Value, IsAsync=True}"> Source="{Binding Image.Value, IsAsync=True}">
<Image.ToolTip> <Image.ToolTip>
<Image <Image Width="250" Height="250"
Width="250"
Height="250"
Source="{Binding Image.Value, IsAsync=True}" /> Source="{Binding Image.Value, IsAsync=True}" />
</Image.ToolTip> </Image.ToolTip>
</Image> </Image>
@ -246,7 +230,8 @@
<ColumnDefinition /> <ColumnDefinition />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Label d:Content="持续时间(ms)" Content="{ll:Str 持续时间(ms)}" /> <Label d:Content="持续时间(ms)" Content="{ll:Str 持续时间(ms)}" />
<pu:NumberInput Grid.Column="1" Value="{Binding DataContext.Duration.Value, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}" /> <pu:NumberInput Grid.Column="1"
Value="{Binding DataContext.Duration.Value, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}" />
</Grid> </Grid>
</Grid> </Grid>
</DataTemplate> </DataTemplate>
@ -255,17 +240,16 @@
</GroupBox> </GroupBox>
<GroupBox Grid.Row="2"> <GroupBox Grid.Row="2">
<GroupBox.Header> <GroupBox.Header>
<StackPanel Orientation="Horizontal" Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"> <StackPanel Orientation="Horizontal"
Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}">
<StackPanel.ContextMenu> <StackPanel.ContextMenu>
<ContextMenu d:DataContext=""> <ContextMenu d:DataContext="">
<MenuItem <MenuItem d:Header="添加食物定位"
d:Header="添加食物定位"
Command="{Binding PlacementTarget.Tag.AddFoodLocationCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" Command="{Binding PlacementTarget.Tag.AddFoodLocationCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 添加食物定位}" Header="{ll:Str 添加食物定位}"
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" /> IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
<MenuItem <MenuItem d:Header="清空食物定位"
d:Header="清空食物定位"
Command="{Binding PlacementTarget.Tag.ClearFoodLocationCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" Command="{Binding PlacementTarget.Tag.ClearFoodLocationCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 清空食物定位}" Header="{ll:Str 清空食物定位}"
@ -275,15 +259,15 @@
<Label d:Content="食物位置" Content="{ll:Str 食物位置}" /> <Label d:Content="食物位置" Content="{ll:Str 食物位置}" />
<TextBlock Margin="10,0,0,0"> <TextBlock Margin="10,0,0,0">
<TextBlock.Text> <TextBlock.Text>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="{}({0})"> <MultiBinding Converter="{StaticResource StringFormatConverter}"
ConverterParameter="{}({0})">
<Binding Path="FoodLocations.Count" /> <Binding Path="FoodLocations.Count" />
</MultiBinding> </MultiBinding>
</TextBlock.Text> </TextBlock.Text>
</TextBlock> </TextBlock>
</StackPanel> </StackPanel>
</GroupBox.Header> </GroupBox.Header>
<ListBox <ListBox d:ItemsSource="{d:SampleData ItemCount=5}"
d:ItemsSource="{d:SampleData ItemCount=5}"
ItemsSource="{Binding FoodLocations, IsAsync=True}" ItemsSource="{Binding FoodLocations, IsAsync=True}"
ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden"
@ -299,8 +283,7 @@
<Grid> <Grid>
<Grid.ContextMenu> <Grid.ContextMenu>
<ContextMenu> <ContextMenu>
<MenuItem <MenuItem d:Header="删除食物定位"
d:Header="删除食物定位"
Command="{Binding PlacementTarget.Tag.RemoveFoodLocationCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" Command="{Binding PlacementTarget.Tag.RemoveFoodLocationCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 删除食物定位}" Header="{ll:Str 删除食物定位}"
@ -321,29 +304,12 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Label d:Content="持续时间 (ms)" Content="{ll:Str 持续时间 (ms)}" /> <Label d:Content="持续时间 (ms)" Content="{ll:Str 持续时间 (ms)}" />
<pu:NumberInput Grid.Column="1" Value="{Binding Duration.Value}" /> <pu:NumberInput Grid.Column="1" Value="{Binding Duration.Value}" />
<Label <Label Grid.Row="1" d:Content="旋转角度" Content="{ll:Str 旋转角度}" />
Grid.Row="1" <pu:NumberInput Grid.Row="1" Grid.Column="1" Value="{Binding Rotate.Value}" />
d:Content="旋转角度" <Label Grid.Row="2" d:Content="透明度" Content="{ll:Str 透明度}" />
Content="{ll:Str 旋转角度}" /> <pu:NumberInput Grid.Row="2" Grid.Column="1" Value="{Binding Opacity.Value}" />
<pu:NumberInput <Label Grid.Row="3" d:Content="长度" Content="{ll:Str 长度}" />
Grid.Row="1" <pu:NumberInput Grid.Row="3" Grid.Column="1"
Grid.Column="1"
Value="{Binding Rotate.Value}" />
<Label
Grid.Row="2"
d:Content="透明度"
Content="{ll:Str 透明度}" />
<pu:NumberInput
Grid.Row="2"
Grid.Column="1"
Value="{Binding Opacity.Value}" />
<Label
Grid.Row="3"
d:Content="长度"
Content="{ll:Str 长度}" />
<pu:NumberInput
Grid.Row="3"
Grid.Column="1"
Value="{Binding Rect.Width.Value}" /> Value="{Binding Rect.Width.Value}" />
<Grid Grid.Row="4" Grid.ColumnSpan="2"> <Grid Grid.Row="4" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@ -375,6 +341,8 @@
</Grid> </Grid>
</Expander> </Expander>
</DataTemplate> </DataTemplate>
</ResourceDictionary>
</Window.Resources> </Window.Resources>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>

View File

@ -11,6 +11,9 @@
Width="500" Width="500"
Height="300" Height="300"
mc:Ignorable="d"> mc:Ignorable="d">
<Window.Resources>
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
</Window.Resources>
<d:Window.DataContext> <d:Window.DataContext>
<local:SelectGraphTypeWindow /> <local:SelectGraphTypeWindow />
</d:Window.DataContext> </d:Window.DataContext>

View File

@ -14,6 +14,9 @@
d:DataContext="{d:DesignInstance Type=vm:ClickTextEditWindowVM}" d:DataContext="{d:DesignInstance Type=vm:ClickTextEditWindowVM}"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<Window.Resources>
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
</Window.Resources>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="300" /> <ColumnDefinition MinWidth="300" />

View File

@ -14,6 +14,9 @@
d:DataContext="{d:DesignInstance Type=vm:FoodEditWindowVM}" d:DataContext="{d:DesignInstance Type=vm:FoodEditWindowVM}"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<Window.Resources>
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
</Window.Resources>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="250" /> <ColumnDefinition Width="250" />

View File

@ -14,6 +14,9 @@
d:DataContext="{d:DesignInstance Type=vm:LowTextEditWindowVM}" d:DataContext="{d:DesignInstance Type=vm:LowTextEditWindowVM}"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<Window.Resources>
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
</Window.Resources>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="300" /> <ColumnDefinition MinWidth="300" />

View File

@ -14,6 +14,9 @@
d:DataContext="{d:DesignInstance Type=vm:ModEditWindowVM}" d:DataContext="{d:DesignInstance Type=vm:ModEditWindowVM}"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<Window.Resources>
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
</Window.Resources>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition /> <ColumnDefinition />

View File

@ -14,6 +14,9 @@
d:DataContext="{d:DesignInstance Type=vm:MoveEditWindowVM}" d:DataContext="{d:DesignInstance Type=vm:MoveEditWindowVM}"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<Window.Resources>
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
</Window.Resources>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />

View File

@ -15,10 +15,11 @@
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<Window.Resources> <Window.Resources>
<Style <ResourceDictionary>
x:Key="Label_ThouchRect" <ResourceDictionary.MergedDictionaries>
BasedOn="{StaticResource {x:Type Label}}" <ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
TargetType="Label"> <ResourceDictionary>
<Style x:Key="Label_ThouchRect" BasedOn="{StaticResource {x:Type Label}}" TargetType="Label">
<Setter Property="Visibility" Value="Collapsed" /> <Setter Property="Visibility" Value="Collapsed" />
<Setter Property="HorizontalAlignment" Value="Left" /> <Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Top" /> <Setter Property="VerticalAlignment" Value="Top" />
@ -33,6 +34,10 @@
</DataTrigger> </DataTrigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources> </Window.Resources>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>

View File

@ -14,6 +14,9 @@
d:DataContext="{d:DesignInstance Type=vm:SelectTextEditWindowVM}" d:DataContext="{d:DesignInstance Type=vm:SelectTextEditWindowVM}"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<Window.Resources>
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
</Window.Resources>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="300" /> <ColumnDefinition MinWidth="300" />

View File

@ -14,6 +14,9 @@
d:DataContext="{d:DesignInstance Type=vm:WorkEditWindowVM}" d:DataContext="{d:DesignInstance Type=vm:WorkEditWindowVM}"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<Window.Resources>
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
</Window.Resources>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />

View File

@ -13,6 +13,9 @@
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<Page.Resources>
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
</Page.Resources>
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
@ -25,7 +28,7 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBox pu:TextBoxHelper.Watermark="{ll:Str 搜索Id}" Text="{Binding Search.Value, UpdateSourceTrigger=PropertyChanged}"> <TextBox pu:TextBoxHelper.Watermark="{ll:Str 搜索Id}" Text="{Binding Search.Value, UpdateSourceTrigger=PropertyChanged}">
<TextBox.Style> <TextBox.Style>
<Style BasedOn="{StaticResource {x:Type TextBox}}" TargetType="TextBox"> <Style BasedOn="{StaticResource StandardTextBoxStyle}" TargetType="TextBox">
<Setter Property="IsEnabled" Value="True" /> <Setter Property="IsEnabled" Value="True" />
<Style.Triggers> <Style.Triggers>
<DataTrigger Binding="{Binding SelectedItem, ElementName=ComboBox_Pet}" Value="{x:Null}"> <DataTrigger Binding="{Binding SelectedItem, ElementName=ComboBox_Pet}" Value="{x:Null}">
@ -36,11 +39,13 @@
</TextBox.Style> </TextBox.Style>
</TextBox> </TextBox>
<ComboBox <ComboBox
MinWidth="150"
x:Name="ComboBox_Pet" x:Name="ComboBox_Pet"
Grid.Column="1" Grid.Column="1"
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}">
<ComboBox.ItemContainerStyle> <ComboBox.ItemContainerStyle>
<Style BasedOn="{StaticResource {x:Type ComboBoxItem}}" TargetType="ComboBoxItem"> <Style BasedOn="{StaticResource {x:Type ComboBoxItem}}" TargetType="ComboBoxItem">

View File

@ -15,6 +15,9 @@
FontSize="16" FontSize="16"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<Window.Resources>
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
</Window.Resources>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition /> <ColumnDefinition />