Assets/ApproveRuleList.xaml
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Theme.xaml" /> <ResourceDictionary Source="Style.xaml" /> </ResourceDictionary.MergedDictionaries> <DataTemplate x:Key="ApproveRuleItemDataTemplate"> <Grid> <StackPanel VerticalAlignment="Center" MinWidth="300"> <TextBlock Text="{Binding TargetGroupNameDisplayText}" /> <TextBlock Text="{Binding ToStringWithoutTargetGroupName}" Foreground="{StaticResource ControlChromeForegroundPressedBrush}" FontSize="12" /> </StackPanel> </Grid> </DataTemplate> <DataTemplate x:Key="ApproveRuleSelectedItemDataTemplate"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions> <StackPanel VerticalAlignment="Center" MinWidth="300"> <TextBox Text="{Binding TargetGroupName}" /> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions> <TextBox x:Name="ApproveWaitDaysTextBox" Text="{Binding ApproveWaitDays}"/> <TextBlock Text="日経過後に承認する" Grid.Column="1" VerticalAlignment="Center"/> </Grid> <StackPanel Orientation="Horizontal"> <CheckBox x:Name="FeatureUpdatesCheckBox" Content="機能更新プログラム" IsChecked="{Binding FeatureUpdates}"/> <CheckBox x:Name="QualityUpdatesCheckBox" Content="品質更新プログラム" IsChecked="{Binding QualityUpdates}"/> </StackPanel> </StackPanel> <MenuItem x:Name="EditMenuItem" Grid.Column="1" ContextMenuService.IsEnabled="False" Command="{Binding EditMenuItem_Click}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="8,0,0,0"> <MenuItem.Icon> <Path Margin="5" Width="2.5" Height="12" Stretch="Fill" Fill="{Binding Path=(TextElement.Foreground), RelativeSource={RelativeSource AncestorType=ContentPresenter}}" Data="F1 M 12,20.8542C 11.7568,20.8542 11.5284,20.8064 11.3147,20.7107C 11.101,20.6151 10.9145,20.4876 10.7551,20.3282C 10.5957,20.1689 10.4682,19.9823 10.3726,19.7686C 10.277,19.555 10.2292,19.3265 10.2292,19.0833C 10.2292,18.8401 10.277,18.6117 10.3726,18.398C 10.4682,18.1843 10.5957,17.9978 10.7551,17.8384C 10.9145,17.6791 11.101,17.5516 11.3147,17.4559C 11.5284,17.3603 11.7568,17.3125 12,17.3125C 12.2432,17.3125 12.4716,17.3603 12.6853,17.4559C 12.899,17.5516 13.0855,17.6791 13.2449,17.8384C 13.4043,17.9978 13.5318,18.1843 13.6274,18.398C 13.723,18.6117 13.7708,18.8401 13.7708,19.0833C 13.7708,19.3265 13.723,19.555 13.6274,19.7686C 13.5318,19.9823 13.4043,20.1689 13.2449,20.3282C 13.0855,20.4876 12.899,20.6151 12.6853,20.7107C 12.4716,20.8064 12.2432,20.8542 12,20.8542 Z M 12,13.7708C 11.7568,13.7708 11.5284,13.723 11.3147,13.6274C 11.101,13.5318 10.9145,13.4043 10.7551,13.2449C 10.5957,13.0855 10.4682,12.899 10.3726,12.6853C 10.277,12.4716 10.2292,12.2432 10.2292,12C 10.2292,11.7568 10.277,11.5284 10.3726,11.3147C 10.4682,11.101 10.5957,10.9145 10.7551,10.7551C 10.9145,10.5957 11.101,10.4682 11.3147,10.3726C 11.5284,10.277 11.7568,10.2292 12,10.2292C 12.2432,10.2292 12.4716,10.277 12.6853,10.3726C 12.899,10.4682 13.0855,10.5957 13.2449,10.7551C 13.4043,10.9145 13.5318,11.101 13.6274,11.3147C 13.723,11.5284 13.7708,11.7568 13.7708,12C 13.7708,12.2432 13.723,12.4716 13.6274,12.6853C 13.5318,12.899 13.4043,13.0855 13.2449,13.2449C 13.0855,13.4043 12.899,13.5318 12.6853,13.6274C 12.4716,13.723 12.2432,13.7708 12,13.7708 Z M 12,6.6875C 11.7568,6.6875 11.5284,6.63968 11.3147,6.54406C 11.101,6.44844 10.9145,6.32094 10.7551,6.16156C 10.5957,6.00219 10.4682,5.81566 10.3726,5.60198C 10.277,5.3883 10.2292,5.15986 10.2292,4.91667C 10.2292,4.67347 10.277,4.44503 10.3726,4.23135C 10.4682,4.01767 10.5957,3.83114 10.7551,3.67177C 10.9145,3.51239 11.101,3.38489 11.3147,3.28927C 11.5284,3.19364 11.7568,3.14583 12,3.14583C 12.2432,3.14583 12.4716,3.19364 12.6853,3.28927C 12.899,3.38489 13.0855,3.51239 13.2449,3.67177C 13.4043,3.83114 13.5318,4.01767 13.6274,4.23135C 13.723,4.44503 13.7708,4.67347 13.7708,4.91667C 13.7708,5.15986 13.723,5.3883 13.6274,5.60198C 13.5318,5.81566 13.4043,6.00219 13.2449,6.16156C 13.0855,6.32094 12.899,6.44844 12.6853,6.54406C 12.4716,6.63968 12.2432,6.6875 12,6.6875 Z "/> </MenuItem.Icon> <MenuItem.ContextMenu> <ContextMenu> <MenuItem x:Name="RemoveItemButton" Header="条件の削除" Command="{Binding RemoveItemButton_Click}"/> </ContextMenu> </MenuItem.ContextMenu> </MenuItem> </Grid> </DataTemplate> <Style x:Key="ApproveRuleList" TargetType="{x:Type ListView}"> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden"/> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden"/> <Setter Property="ScrollViewer.CanContentScroll" Value="false"/> <Setter Property="ScrollViewer.PanningMode" Value="Both"/> <Setter Property="Stylus.IsFlicksEnabled" Value="False"/> <Setter Property="VerticalContentAlignment" Value="Center"/> <Setter Property="ItemTemplate" Value="{DynamicResource ApproveRuleItemDataTemplate}"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ListView}"> <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="ApproveListListViewItemContainerStyle" TargetType="{x:Type ListViewItem}"> <Setter Property="IsSelected" Value="{Binding IsSelected}" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ListViewItem}"> <Border x:Name="border" BorderBrush="{StaticResource ControlChromeBorderBrush}" BorderThickness="1" Background="{StaticResource ControlChromeBackgroundBrush}" CornerRadius="3" SnapsToDevicePixels="true" Padding="20,18"> <ContentPresenter x:Name="Contents" HorizontalAlignment="Stretch" RecognizesAccessKey="True" SnapsToDevicePixels="True"/> </Border> <ControlTemplate.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter Property="ContentTemplate" TargetName="Contents" Value="{DynamicResource ApproveRuleSelectedItemDataTemplate}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> </ResourceDictionary> |