支持桌宠风格化

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,7 +14,10 @@
d:DataContext="{d:DesignInstance Type=vm:AddCultureWindowVM}" d:DataContext="{d:DesignInstance Type=vm:AddCultureWindowVM}"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<Grid> <Window.Resources>
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition /> <ColumnDefinition />
<ColumnDefinition Width="Auto" MinWidth="100" /> <ColumnDefinition Width="Auto" MinWidth="100" />

View File

@ -15,366 +15,334 @@
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>
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> <Style x:Key="ListBoxItem_Style" BasedOn="{StaticResource {x:Type ListBoxItem}}" TargetType="ListBoxItem">
<Setter Property="VerticalContentAlignment" Value="Stretch" /> <Setter Property="HorizontalContentAlignment" Value="Stretch" />
</Style> <Setter Property="VerticalContentAlignment" Value="Stretch" />
<DataTemplate x:Key="Expander_AnimeItem" DataType="Expander"> </Style>
<Expander <DataTemplate x:Key="Expander_AnimeItem" DataType="Expander">
HorizontalAlignment="Stretch" <Expander HorizontalAlignment="Stretch" VerticalAlignment="Top" d:DataContext="">
VerticalAlignment="Top" <Expander.Header>
d:DataContext=""> <Grid
<Expander.Header> 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 d:Header="添加图片"
<MenuItem Command="{Binding PlacementTarget.Tag.RemoveAnimeCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
d:Header="添加图片" CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Command="{Binding PlacementTarget.Tag.RemoveAnimeCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" Header="{ll:Str 删除此动画}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
Header="{ll:Str 删除此动画}" </ContextMenu>
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" /> </Grid.ContextMenu>
</ContextMenu> <Grid.ColumnDefinitions>
</Grid.ContextMenu> <ColumnDefinition Width="Auto" />
<Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" /> <TextBlock Margin="10,0,10,0">
</Grid.ColumnDefinitions> <TextBlock.Text>
<TextBlock Margin="10,0,10,0"> <MultiBinding Converter="{StaticResource StringFormatConverter}"
<TextBlock.Text> 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" /> </MultiBinding>
</MultiBinding> </TextBlock.Text>
</TextBlock.Text> </TextBlock>
</TextBlock> <!--<TextBox
<!--<TextBox Grid.Column="1"
Grid.Column="1" pu:TextBoxHelper.Watermark="{ll:Str 动画Id(非必要)}"
pu:TextBoxHelper.Watermark="{ll:Str 动画Id(非必要)}" Text="{Binding Id.Value, UpdateSourceTrigger=PropertyChanged}" />-->
Text="{Binding Id.Value, UpdateSourceTrigger=PropertyChanged}" />--> <!-- pu:TextBoxHelper.Watermark="{ll:Str 动画Id(非必要)}" -->
<!-- pu:TextBoxHelper.Watermark="{ll:Str 动画Id(非必要)}" --> </Grid>
</Grid> </Expander.Header>
</Expander.Header> <Grid>
<Grid> <Grid.RowDefinitions>
<Grid.RowDefinitions> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> </Grid.RowDefinitions>
</Grid.RowDefinitions> <GroupBox>
<GroupBox> <GroupBox.Header>
<GroupBox.Header> <StackPanel Orientation="Horizontal"
<StackPanel Orientation="Horizontal" Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"> 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 d:Header="添加图片"
<MenuItem Command="{Binding PlacementTarget.Tag.ClearFrontImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
d:Header="添加图片" CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Command="{Binding PlacementTarget.Tag.ClearFrontImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" Header="{ll:Str 清空图片}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
Header="{ll:Str 清空图片}" </ContextMenu>
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" /> </StackPanel.ContextMenu>
</ContextMenu> <Label d:Content="顶层图片" Content="{ll:Str 顶层图片}" />
</StackPanel.ContextMenu> <TextBlock Margin="10,0,0,0">
<Label d:Content="顶层图片" Content="{ll:Str 顶层图片}" /> <TextBlock.Text>
<TextBlock Margin="10,0,0,0"> <MultiBinding Converter="{StaticResource StringFormatConverter}"
<TextBlock.Text> 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 x:Name="ListBox_FrontImages" d:ItemsSource="{d:SampleData ItemCount=5}"
<ListBox AllowDrop="True" Drop="ListBox_Drop"
x:Name="ListBox_FrontImages" ItemsSource="{Binding FrontImages, IsAsync=True}"
d:ItemsSource="{d:SampleData ItemCount=5}" PreviewMouseMove="ListBox_PreviewMouseMove"
AllowDrop="True" ScrollViewer.HorizontalScrollBarVisibility="Auto"
Drop="ListBox_Drop" ScrollViewer.VerticalScrollBarVisibility="Hidden"
ItemsSource="{Binding FrontImages, IsAsync=True}" SelectedItem="{Binding DataContext.CurrentFrontImageModel.Value, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"
PreviewMouseMove="ListBox_PreviewMouseMove" SelectionChanged="ListBox_SelectionChanged">
ScrollViewer.HorizontalScrollBarVisibility="Auto" <ListBox.ItemsPanel>
ScrollViewer.VerticalScrollBarVisibility="Hidden" <ItemsPanelTemplate>
SelectedItem="{Binding DataContext.CurrentFrontImageModel.Value, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}" <StackPanel Orientation="Horizontal" />
SelectionChanged="ListBox_SelectionChanged"> </ItemsPanelTemplate>
<ListBox.ItemsPanel> </ListBox.ItemsPanel>
<ItemsPanelTemplate> <ListBox.ItemTemplate>
<StackPanel Orientation="Horizontal" /> <DataTemplate>
</ItemsPanelTemplate> <Grid
</ListBox.ItemsPanel> DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Expander, Mode=FindAncestor}}"
<ListBox.ItemTemplate> Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}">
<DataTemplate> <Grid.ContextMenu>
<Grid DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Expander, Mode=FindAncestor}}" Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"> <ContextMenu>
<Grid.ContextMenu> <MenuItem d:Header="修改图片"
<ContextMenu> Command="{Binding PlacementTarget.Tag.ChangeFrontImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
<MenuItem CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
d:Header="修改图片" Header="{ll:Str 修改图片}"
Command="{Binding PlacementTarget.Tag.ChangeFrontImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" <MenuItem d:Header="删除图片"
Header="{ll:Str 修改图片}" Command="{Binding PlacementTarget.Tag.RemoveFrontImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" /> CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
<MenuItem Header="{ll:Str 删除图片}"
d:Header="删除图片" IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
Command="{Binding PlacementTarget.Tag.RemoveFrontImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" </ContextMenu>
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" </Grid.ContextMenu>
Header="{ll:Str 删除图片}" <Grid.RowDefinitions>
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" /> <RowDefinition Height="Auto" />
</ContextMenu> <RowDefinition />
</Grid.ContextMenu> </Grid.RowDefinitions>
<Grid.RowDefinitions> <Image Width="150" Height="150" d:DataContext=""
<RowDefinition Height="Auto" /> DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}"
<RowDefinition /> Source="{Binding Image.Value, IsAsync=True}">
</Grid.RowDefinitions> <Image.ToolTip>
<Image <Image Width="250" Height="250"
Width="150" Source="{Binding Image.Value, IsAsync=True}" />
Height="150" </Image.ToolTip>
d:DataContext="" </Image>
DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}" <Grid Grid.Row="1">
Source="{Binding Image.Value, IsAsync=True}"> <Grid.ColumnDefinitions>
<Image.ToolTip> <ColumnDefinition Width="Auto" />
<Image <ColumnDefinition />
Width="250" </Grid.ColumnDefinitions>
Height="250" <Label d:Content="持续时间(ms)" Content="{ll:Str 持续时间(ms)}" />
Source="{Binding Image.Value, IsAsync=True}" /> <pu:NumberInput Grid.Column="1"
</Image.ToolTip> Value="{Binding DataContext.Duration.Value, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}" />
</Image> </Grid>
<Grid Grid.Row="1"> </Grid>
<Grid.ColumnDefinitions> </DataTemplate>
<ColumnDefinition Width="Auto" /> </ListBox.ItemTemplate>
<ColumnDefinition /> </ListBox>
</Grid.ColumnDefinitions> </GroupBox>
<Label d:Content="持续时间(ms)" Content="{ll:Str 持续时间(ms)}" /> <GroupBox Grid.Row="1">
<pu:NumberInput Grid.Column="1" Value="{Binding DataContext.Duration.Value, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}" /> <GroupBox.Header>
<StackPanel Orientation="Horizontal"
Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}">
<StackPanel.ContextMenu>
<ContextMenu d:DataContext="">
<MenuItem d:Header="添加图片"
Command="{Binding PlacementTarget.Tag.AddBackImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 添加图片}"
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
<MenuItem d:Header="添加图片"
Command="{Binding PlacementTarget.Tag.ClearBackImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 清空图片}"
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
</ContextMenu>
</StackPanel.ContextMenu>
<Label d:Content="底层图片" Content="{ll:Str 底层图片}" />
<TextBlock Margin="10,0,0,0">
<TextBlock.Text>
<MultiBinding Converter="{StaticResource StringFormatConverter}"
ConverterParameter="{}({0})">
<Binding Path="BackImages.Count" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</StackPanel>
</GroupBox.Header>
<ListBox x:Name="ListBox_BackImages" d:ItemsSource="{d:SampleData ItemCount=5}"
AllowDrop="True" Drop="ListBox_Drop"
ItemsSource="{Binding BackImages, IsAsync=True}"
PreviewMouseMove="ListBox_PreviewMouseMove"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Hidden"
SelectedItem="{Binding DataContext.CurrentBackImageModel.Value, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"
SelectionChanged="ListBox_SelectionChanged">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid
DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Expander, Mode=FindAncestor}}"
Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}">
<Grid.ContextMenu>
<ContextMenu>
<MenuItem d:Header="修改图片"
Command="{Binding PlacementTarget.Tag.ChangeBackImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 修改图片}"
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
<MenuItem d:Header="删除图片"
Command="{Binding PlacementTarget.Tag.RemoveBackImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 删除图片}"
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
</ContextMenu>
</Grid.ContextMenu>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Image Width="150" Height="150" d:DataContext=""
DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}"
Source="{Binding Image.Value, IsAsync=True}">
<Image.ToolTip>
<Image Width="250" Height="250"
Source="{Binding Image.Value, IsAsync=True}" />
</Image.ToolTip>
</Image>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label d:Content="持续时间(ms)" Content="{ll:Str 持续时间(ms)}" />
<pu:NumberInput Grid.Column="1"
Value="{Binding DataContext.Duration.Value, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}" />
</Grid>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</GroupBox>
<GroupBox Grid.Row="2">
<GroupBox.Header>
<StackPanel Orientation="Horizontal"
Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}">
<StackPanel.ContextMenu>
<ContextMenu d:DataContext="">
<MenuItem d:Header="添加食物定位"
Command="{Binding PlacementTarget.Tag.AddFoodLocationCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 添加食物定位}"
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
<MenuItem d:Header="清空食物定位"
Command="{Binding PlacementTarget.Tag.ClearFoodLocationCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 清空食物定位}"
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
</ContextMenu>
</StackPanel.ContextMenu>
<Label d:Content="食物位置" Content="{ll:Str 食物位置}" />
<TextBlock Margin="10,0,0,0">
<TextBlock.Text>
<MultiBinding Converter="{StaticResource StringFormatConverter}"
ConverterParameter="{}({0})">
<Binding Path="FoodLocations.Count" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</StackPanel>
</GroupBox.Header>
<ListBox d:ItemsSource="{d:SampleData ItemCount=5}"
ItemsSource="{Binding FoodLocations, IsAsync=True}"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Hidden"
SelectedItem="{Binding DataContext.CurrentFoodLocationModel.Value, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"
SelectionChanged="ListBox_SelectionChanged">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ContextMenu>
<ContextMenu>
<MenuItem d:Header="删除食物定位"
Command="{Binding PlacementTarget.Tag.RemoveFoodLocationCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 删除食物定位}"
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
</ContextMenu>
</Grid.ContextMenu>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label d:Content="持续时间 (ms)" Content="{ll:Str 持续时间 (ms)}" />
<pu:NumberInput Grid.Column="1" Value="{Binding Duration.Value}" />
<Label Grid.Row="1" d:Content="旋转角度" Content="{ll:Str 旋转角度}" />
<pu:NumberInput Grid.Row="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}" />
<Grid Grid.Row="4" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Content="X:" />
<pu:NumberInput Grid.Column="1" Value="{Binding Rect.X.Value}" />
</Grid>
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Content="Y:" />
<pu:NumberInput Grid.Column="1" Value="{Binding Rect.Y.Value}" />
</Grid>
</Grid>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</GroupBox>
</Grid> </Grid>
</Grid> </Expander>
</DataTemplate> </DataTemplate>
</ListBox.ItemTemplate> </ResourceDictionary>
</ListBox>
</GroupBox>
<GroupBox Grid.Row="1">
<GroupBox.Header>
<StackPanel Orientation="Horizontal" Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}">
<StackPanel.ContextMenu>
<ContextMenu d:DataContext="">
<MenuItem
d:Header="添加图片"
Command="{Binding PlacementTarget.Tag.AddBackImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 添加图片}"
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
<MenuItem
d:Header="添加图片"
Command="{Binding PlacementTarget.Tag.ClearBackImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 清空图片}"
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
</ContextMenu>
</StackPanel.ContextMenu>
<Label d:Content="底层图片" Content="{ll:Str 底层图片}" />
<TextBlock Margin="10,0,0,0">
<TextBlock.Text>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="{}({0})">
<Binding Path="BackImages.Count" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</StackPanel>
</GroupBox.Header>
<ListBox
x:Name="ListBox_BackImages"
d:ItemsSource="{d:SampleData ItemCount=5}"
AllowDrop="True"
Drop="ListBox_Drop"
ItemsSource="{Binding BackImages, IsAsync=True}"
PreviewMouseMove="ListBox_PreviewMouseMove"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Hidden"
SelectedItem="{Binding DataContext.CurrentBackImageModel.Value, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"
SelectionChanged="ListBox_SelectionChanged">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Expander, Mode=FindAncestor}}" Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}">
<Grid.ContextMenu>
<ContextMenu>
<MenuItem
d:Header="修改图片"
Command="{Binding PlacementTarget.Tag.ChangeBackImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 修改图片}"
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
<MenuItem
d:Header="删除图片"
Command="{Binding PlacementTarget.Tag.RemoveBackImageCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 删除图片}"
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
</ContextMenu>
</Grid.ContextMenu>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Image
Width="150"
Height="150"
d:DataContext=""
DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}"
Source="{Binding Image.Value, IsAsync=True}">
<Image.ToolTip>
<Image
Width="250"
Height="250"
Source="{Binding Image.Value, IsAsync=True}" />
</Image.ToolTip>
</Image>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label d:Content="持续时间(ms)" Content="{ll:Str 持续时间(ms)}" />
<pu:NumberInput Grid.Column="1" Value="{Binding DataContext.Duration.Value, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}" />
</Grid>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</GroupBox>
<GroupBox Grid.Row="2">
<GroupBox.Header>
<StackPanel Orientation="Horizontal" Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}">
<StackPanel.ContextMenu>
<ContextMenu d:DataContext="">
<MenuItem
d:Header="添加食物定位"
Command="{Binding PlacementTarget.Tag.AddFoodLocationCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 添加食物定位}"
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
<MenuItem
d:Header="清空食物定位"
Command="{Binding PlacementTarget.Tag.ClearFoodLocationCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 清空食物定位}"
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
</ContextMenu>
</StackPanel.ContextMenu>
<Label d:Content="食物位置" Content="{ll:Str 食物位置}" />
<TextBlock Margin="10,0,0,0">
<TextBlock.Text>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="{}({0})">
<Binding Path="FoodLocations.Count" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</StackPanel>
</GroupBox.Header>
<ListBox
d:ItemsSource="{d:SampleData ItemCount=5}"
ItemsSource="{Binding FoodLocations, IsAsync=True}"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Hidden"
SelectedItem="{Binding DataContext.CurrentFoodLocationModel.Value, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"
SelectionChanged="ListBox_SelectionChanged">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ContextMenu>
<ContextMenu>
<MenuItem
d:Header="删除食物定位"
Command="{Binding PlacementTarget.Tag.RemoveFoodLocationCommand, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}"
Header="{ll:Str 删除食物定位}"
IsEnabled="{Binding PlacementTarget.Tag.PlayCommand.CurrentCanExecute.Value, RelativeSource={RelativeSource AncestorType=ContextMenu, Mode=FindAncestor}}" />
</ContextMenu>
</Grid.ContextMenu>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label d:Content="持续时间 (ms)" Content="{ll:Str 持续时间 (ms)}" />
<pu:NumberInput Grid.Column="1" Value="{Binding Duration.Value}" />
<Label
Grid.Row="1"
d:Content="旋转角度"
Content="{ll:Str 旋转角度}" />
<pu:NumberInput
Grid.Row="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}" />
<Grid Grid.Row="4" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Content="X:" />
<pu:NumberInput Grid.Column="1" Value="{Binding Rect.X.Value}" />
</Grid>
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Content="Y:" />
<pu:NumberInput Grid.Column="1" Value="{Binding Rect.Y.Value}" />
</Grid>
</Grid>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</GroupBox>
</Grid>
</Expander>
</DataTemplate>
</Window.Resources> </Window.Resources>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -14,25 +14,30 @@
d:DataContext="{d:DesignInstance Type=vm:PetEditWindowVM}" d:DataContext="{d:DesignInstance Type=vm:PetEditWindowVM}"
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>
<Setter Property="Visibility" Value="Collapsed" /> <Style x:Key="Label_ThouchRect" BasedOn="{StaticResource {x:Type Label}}" TargetType="Label">
<Setter Property="HorizontalAlignment" Value="Left" /> <Setter Property="Visibility" Value="Collapsed" />
<Setter Property="VerticalAlignment" Value="Top" /> <Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="HorizontalContentAlignment" Value="Center" /> <Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="BorderThickness" Value="1" /> <Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Background" Value="#19FF0000" /> <Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="Red" /> <Setter Property="Background" Value="#19FF0000" />
<Style.Triggers> <Setter Property="BorderBrush" Value="Red" />
<DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource Mode=Self}}" Value="True"> <Style.Triggers>
<Setter Property="Visibility" Value="Visible" /> <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource Mode=Self}}" Value="True">
</DataTrigger> <Setter Property="Visibility" Value="Visible" />
</Style.Triggers> </DataTrigger>
</Style> </Style.Triggers>
</Style>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources> </Window.Resources>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>

View File

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

View File

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

View File

@ -13,7 +13,10 @@
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<Grid> <Page.Resources>
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
</Page.Resources>
<Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition />
@ -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,7 +15,10 @@
FontSize="16" FontSize="16"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<Grid> <Window.Resources>
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition /> <ColumnDefinition />
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />