ItemsTemplates.xaml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:resx="clr-namespace:GDNXFD.Alert.Config.Resources.Strings">
  4. <ResourceDictionary.MergedDictionaries>
  5. <ResourceDictionary Source="/Resources/Common/CommonResources.xaml"/>
  6. <ResourceDictionary Source="/Resources/Common/RadioButtonStyles.xaml"/>
  7. </ResourceDictionary.MergedDictionaries>
  8. <ObjectDataProvider x:Key="Provider" ObjectType="{x:Type resx:StringProvider}" MethodName="GetResourceInstance"></ObjectDataProvider>
  9. <DataTemplate x:Key="ListRulesTemplate">
  10. <Grid Height="70" HorizontalAlignment="Stretch" Margin="0,0,0,5">
  11. <Grid.ColumnDefinitions>
  12. <ColumnDefinition Width="70"></ColumnDefinition>
  13. <ColumnDefinition Width="150"></ColumnDefinition>
  14. <ColumnDefinition Width="*"></ColumnDefinition>
  15. <ColumnDefinition Width="*"></ColumnDefinition>
  16. <ColumnDefinition Width="70"></ColumnDefinition>
  17. <ColumnDefinition Width="70"></ColumnDefinition>
  18. <ColumnDefinition Width="70"></ColumnDefinition>
  19. </Grid.ColumnDefinitions>
  20. <!--
  21. <Image Source="{Binding EmployeePhoto, Converter={StaticResource ByteToImageConverter}}" Margin="0,0,5,0"
  22. Width="auto" Height="auto" Grid.Column="0" Stretch="UniformToFill"></Image>
  23. -->
  24. <Border Background="{StaticResource module-primary-color-over-brush}" Grid.Column="0" Margin="0,0,5,0">
  25. <TextBlock TextWrapping="NoWrap" TextTrimming="WordEllipsis" HorizontalAlignment="Center" VerticalAlignment="Center">
  26. <Run Style="{StaticResource ListTextBigLight}" Text="{Binding Id}"></Run>
  27. </TextBlock>
  28. </Border>
  29. <Border Background="{StaticResource module-primary-color-light-brush}" Grid.Column="1" Margin="0,0,5,0"
  30. Padding="15,10,5,5">
  31. <TextBlock TextWrapping="NoWrap" TextTrimming="WordEllipsis">
  32. <Run Style="{StaticResource ListTextBigLight}" Text="{Binding Name}"></Run>
  33. <LineBreak></LineBreak>
  34. <Run Style="{StaticResource ListTextSmallLight}" Text="{Binding Rank}"></Run>
  35. </TextBlock>
  36. </Border>
  37. <Border Background="{StaticResource second-background-color-brush}" Grid.Column="2"
  38. Padding="15,10,5,5">
  39. <TextBlock TextWrapping="NoWrap" TextTrimming="WordEllipsis">
  40. <Run Style="{StaticResource ListTextBigDark}" Text="{Binding Expression}"></Run>
  41. </TextBlock>
  42. </Border>
  43. <Border Background="{StaticResource second-background-color-brush}" Grid.Column="3" Margin="0,0,5,0"
  44. Padding="15,10,5,5">
  45. <TextBlock TextWrapping="NoWrap" TextTrimming="WordEllipsis">
  46. <Run Style="{StaticResource ListTextBigDark}" Text="{Binding Description}"></Run>
  47. <LineBreak></LineBreak>
  48. <Run Style="{StaticResource ListTextSmallDark}" Text="{Binding Tag}"></Run>
  49. </TextBlock>
  50. </Border>
  51. <Button CommandParameter="{Binding}" Margin="0,0,5,0"
  52. ToolTip="{Binding Edit, Source={StaticResource Provider}, Mode=OneWay}"
  53. Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Path=DataContext.EditRuleCommand }"
  54. Style="{StaticResource PrimaryColorButtonStyle}"
  55. Grid.Column="4">
  56. <Button.Content>
  57. <Image Source="/Resources/Images/edit.png" Width="21" Height="21"></Image>
  58. </Button.Content>
  59. </Button>
  60. <Button CommandParameter="{Binding}" Style="{StaticResource PrimaryColorDarkButtonStyle}" Grid.Column="5" Margin="0,0,5,0"
  61. ToolTip="{Binding Complete, Source={StaticResource Provider}, Mode=OneWay}"
  62. Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Path=DataContext.ViewRuleCommand}">
  63. <Button.Content>
  64. <Image Source="/Resources/Images/statusApprovedWhite.png" Width="20" Height="16"></Image>
  65. </Button.Content>
  66. </Button>
  67. <Button CommandParameter="{Binding Id}" Style="{StaticResource AlternativeColorButtonStyle}" Grid.Column="6"
  68. ToolTip="{Binding Remove, Source={StaticResource Provider}, Mode=OneWay}"
  69. Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Path=DataContext.RemoveRuleCommand}">
  70. <Button.Content>
  71. <Image Source="/Resources/Images/cancel.png" Width="18" Height="18"></Image>
  72. </Button.Content>
  73. </Button>
  74. </Grid>
  75. </DataTemplate>
  76. <DataTemplate x:Key="ListPagesTemplate">
  77. <RadioButton Content="{Binding Page}" IsChecked="{Binding IsCurrentPage, Mode=TwoWay}" IsEnabled="{Binding IsClickable}"
  78. GroupName="Pages" Template="{StaticResource RadioButtonNumberOfPage}"></RadioButton>
  79. </DataTemplate>
  80. <DataTemplate x:Key="AttachmentsTemplate">
  81. <Grid>
  82. <Grid.ColumnDefinitions>
  83. <ColumnDefinition></ColumnDefinition>
  84. <ColumnDefinition Width="50"></ColumnDefinition>
  85. <ColumnDefinition Width="50"></ColumnDefinition>
  86. </Grid.ColumnDefinitions>
  87. <TextBlock Grid.Column="0" VerticalAlignment="Center" >
  88. <Run Style="{StaticResource ListTextSmallDark}" Text="{Binding Name}"></Run>
  89. </TextBlock>
  90. <Button Visibility="{Binding TravelAttachmentId, Converter={StaticResource IdToVisibilityConverter}}" Grid.Column="1"
  91. ToolTip="{Binding DownloadAttachment, Source={StaticResource Provider}, Mode=OneWay}"
  92. CommandParameter="{Binding}"
  93. Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Path=DataContext.DownloadAttachmentCommand}"
  94. Style="{StaticResource TransparentButtonStyle}">
  95. <Image Stretch="None" Source="/Resources/Images/file-download.png" ></Image>
  96. </Button>
  97. <Button Grid.Column="2" Style="{StaticResource TransparentButtonStyle}" Height="50"
  98. ToolTip="{Binding RemoveAttachment, Source={StaticResource Provider}, Mode=OneWay}"
  99. CommandParameter="{Binding}"
  100. Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Path=DataContext.RemoveAttachmentCommand}">
  101. <Image Stretch="None" Source="/Resources/Images/file-delete.png" ></Image>
  102. </Button>
  103. </Grid>
  104. </DataTemplate>
  105. <DataTemplate x:Key="TestingPointTemplate">
  106. <Grid>
  107. <Grid.ColumnDefinitions>
  108. <ColumnDefinition Name="名称"></ColumnDefinition>
  109. <ColumnDefinition Name="编码"></ColumnDefinition>
  110. </Grid.ColumnDefinitions>
  111. <TextBlock Grid.Column="0" VerticalAlignment="Center" >
  112. <Run Style="{StaticResource ListTextSmallDark}" Text="{Binding UniformCode}"></Run>
  113. </TextBlock>
  114. <TextBlock Grid.Column="1" VerticalAlignment="Center" Margin="15 0 0 0" >
  115. <Run Style="{StaticResource ListTextSmallDark}" Text="{Binding Name}"></Run>
  116. </TextBlock>
  117. </Grid>
  118. </DataTemplate>
  119. <Style x:Key="AlternativeColorItemStyle" TargetType="ListBoxItem" >
  120. <Setter Property="Template">
  121. <Setter.Value>
  122. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  123. <Border x:Name="bdr_main" Background="{StaticResource module-alternative-color-brush}">
  124. <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Content" />
  125. </Border>
  126. <ControlTemplate.Triggers>
  127. <Trigger Property="IsMouseOver" Value="True">
  128. <Setter TargetName="bdr_main" Property="Background" Value="{StaticResource module-alternative-color-over-brush}"/>
  129. </Trigger>
  130. </ControlTemplate.Triggers>
  131. </ControlTemplate>
  132. </Setter.Value>
  133. </Setter>
  134. <Setter Property="Margin" Value="2 2 2 2"/>
  135. <Setter Property="MaxHeight" Value="30" />
  136. <Setter Property="FontSize" Value="16"/>
  137. <Setter Property="FontWeight" Value="Bold"/>
  138. <Setter Property="Foreground" Value="{StaticResource list-info-font-color-light-brush}"/>
  139. </Style>
  140. </ResourceDictionary>