CreateFromScannerDialogs.xaml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <UserControl x:Class="PDF_Master.Views.Dialog.HomePageToolsDialogs.CreateFromScannerDialogs"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:cus="clr-namespace:PDF_Master.CustomControl"
  7. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  8. xmlns:prism="http://prismlibrary.com/"
  9. xmlns:dataconvert="clr-namespace:PDF_Master.DataConvert"
  10. xmlns:local="clr-namespace:PDF_Master.Views.Dialog.HomePageToolsDialogs"
  11. mc:Ignorable="d"
  12. d:DesignHeight="450" d:DesignWidth="800">
  13. <UserControl.Resources>
  14. <dataconvert:BoolToVisible x:Key="BoolToVisible"/>
  15. <dataconvert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert"/>
  16. <Style x:Key="ScannerListViewItemStyle" TargetType="{x:Type ListViewItem}">
  17. <Setter Property="UIElement.SnapsToDevicePixels" Value="True" />
  18. <Setter Property="Panel.Background" Value="#00FFFFFF" />
  19. <Setter Property="Border.BorderBrush" Value="#00FFFFFF" />
  20. <Setter Property="Border.BorderThickness" Value="1" />
  21. <Setter Property="FrameworkElement.FocusVisualStyle">
  22. <Setter.Value>
  23. <Style TargetType="{x:Type IFrameworkInputElement}">
  24. <Setter Property="Control.Template">
  25. <Setter.Value>
  26. <ControlTemplate>
  27. <Rectangle
  28. Margin="2"
  29. SnapsToDevicePixels="True"
  30. Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
  31. StrokeDashArray="1 2"
  32. StrokeThickness="1" />
  33. </ControlTemplate>
  34. </Setter.Value>
  35. </Setter>
  36. </Style>
  37. </Setter.Value>
  38. </Setter>
  39. <Setter Property="Control.Template">
  40. <Setter.Value>
  41. <ControlTemplate TargetType="{x:Type ListViewItem}">
  42. <Border
  43. Name="Bd"
  44. Padding="{TemplateBinding Control.Padding}"
  45. Background="{TemplateBinding Panel.Background}"
  46. BorderBrush="{TemplateBinding Border.BorderBrush}"
  47. BorderThickness="{TemplateBinding Border.BorderThickness}"
  48. SnapsToDevicePixels="True">
  49. <Grid>
  50. <Grid.ColumnDefinitions>
  51. <ColumnDefinition Width="Auto" />
  52. <ColumnDefinition />
  53. </Grid.ColumnDefinitions>
  54. <Grid
  55. x:Name="SelectedIcon"
  56. Margin="12.5,0,0.5,0"
  57. HorizontalAlignment="Left"
  58. VerticalAlignment="Center"
  59. Visibility="Collapsed">
  60. <Rectangle
  61. x:Name="Selectedrect"
  62. Width="20"
  63. Height="20"
  64. HorizontalAlignment="Right"
  65. VerticalAlignment="Top"
  66. Fill="#FF477EDE" />
  67. <Path
  68. x:Name="MultiSelectCheck"
  69. Width="15"
  70. Height="15"
  71. Margin="0,1,0,0"
  72. HorizontalAlignment="Center"
  73. VerticalAlignment="Center"
  74. Data="M15.3493 0.596191L16.0564 1.3033L5.44979 11.9099L0.146484 6.6066L0.853591 5.89949L5.45004 10.496L15.3493 0.596191Z"
  75. Fill="White" />
  76. </Grid>
  77. <ContentPresenter
  78. Grid.Column="1"
  79. Margin="0,0,0,0"
  80. HorizontalAlignment="Stretch"
  81. VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
  82. Content="{TemplateBinding ContentControl.Content}"
  83. ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
  84. ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
  85. SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
  86. <Rectangle
  87. Grid.Column="1"
  88. Height="1"
  89. HorizontalAlignment="Stretch"
  90. VerticalAlignment="Bottom"
  91. Fill="#C5CBD3" />
  92. </Grid>
  93. </Border>
  94. <ControlTemplate.Triggers>
  95. <MultiTrigger>
  96. <MultiTrigger.Conditions>
  97. <Condition Property="UIElement.IsMouseOver" Value="True" />
  98. </MultiTrigger.Conditions>
  99. <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.hov.bg}" />
  100. <!--<Setter TargetName="Bd" Property="Border.BorderBrush" Value="#1A000000" />-->
  101. </MultiTrigger>
  102. <MultiTrigger>
  103. <MultiTrigger.Conditions>
  104. <Condition Property="Selector.IsSelectionActive" Value="False" />
  105. <Condition Property="Selector.IsSelected" Value="True" />
  106. </MultiTrigger.Conditions>
  107. <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
  108. <!--<Setter TargetName="Bd" Property="Border.BorderBrush" Value="#1A477EDE" />-->
  109. <!--<Setter TargetName="SelectedIcon" Property="Grid.Visibility" Value="Visible" />-->
  110. </MultiTrigger>
  111. <MultiTrigger>
  112. <MultiTrigger.Conditions>
  113. <Condition Property="Selector.IsSelectionActive" Value="True" />
  114. <Condition Property="Selector.IsSelected" Value="True" />
  115. </MultiTrigger.Conditions>
  116. <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
  117. <!--<Setter TargetName="Bd" Property="Border.BorderBrush" Value="#1A477EDE" />-->
  118. <!--<Setter TargetName="SelectedIcon" Property="Grid.Visibility" Value="Visible" />-->
  119. </MultiTrigger>
  120. <Trigger Property="UIElement.IsEnabled" Value="False">
  121. <Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  122. </Trigger>
  123. </ControlTemplate.Triggers>
  124. </ControlTemplate>
  125. </Setter.Value>
  126. </Setter>
  127. </Style>
  128. <DataTemplate x:Key="ScannerItemTemplate">
  129. <TextBlock Text="{Binding ScannerName}">
  130. </TextBlock>
  131. </DataTemplate>
  132. </UserControl.Resources>
  133. <cus:DialogContent Header="Create PDF from scanner">
  134. <Grid>
  135. <Grid Height="406" Margin="16,0,16,0"
  136. Visibility="{Binding IsEmptyScanner,Converter={StaticResource InvertBoolToVisibleConvert}}"
  137. >
  138. <Grid.ColumnDefinitions>
  139. <ColumnDefinition Width="360"/>
  140. <ColumnDefinition Width="16"/>
  141. <ColumnDefinition Width="312"/>
  142. </Grid.ColumnDefinitions>
  143. <Border Background="{StaticResource color.sys.layout.mg}">
  144. <Grid>
  145. <Grid.RowDefinitions>
  146. <RowDefinition Height="Auto"/>
  147. <RowDefinition/>
  148. </Grid.RowDefinitions>
  149. <TextBlock Text="Scanners"/>
  150. <ListView Grid.Row="1" x:Name="listScanner"
  151. ItemsSource="{Binding Scanners}"
  152. ItemContainerStyle="{StaticResource ScannerListViewItemStyle}"
  153. ItemTemplate="{StaticResource ScannerItemTemplate}"
  154. >
  155. <i:Interaction.Triggers>
  156. <i:EventTrigger EventName="SelectionChanged">
  157. <i:InvokeCommandAction Command="{Binding SelectedScannerCommand}" CommandParameter="{Binding ElementName=listScanner,Path=SelectedItem}"/>
  158. </i:EventTrigger>
  159. </i:Interaction.Triggers>
  160. </ListView>
  161. </Grid>
  162. </Border>
  163. <Border Grid.Column="2" CornerRadius="6" BorderThickness="1" BorderBrush="{StaticResource color.sys.layout.divider}">
  164. <Grid>
  165. <Image x:Name="ScannerImage" Source="{Binding Img}"
  166. Visibility="{Binding IsEmptyImg,Converter={StaticResource InvertBoolToVisibleConvert}}"
  167. >
  168. </Image>
  169. <TextBlock Text="NO Image" FontSize="25" HorizontalAlignment="Center" VerticalAlignment="Center"
  170. Visibility="{Binding IsEmptyImg,Converter={StaticResource BoolToVisible}}"
  171. />
  172. </Grid>
  173. </Border>
  174. </Grid>
  175. <Grid Height="406" Margin="16,0,16,0" Visibility="{Binding IsEmptyScanner,Converter={StaticResource BoolToVisible}}">
  176. <TextBlock Text="No Scanners" FontSize="30" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  177. </Grid>
  178. </Grid>
  179. <cus:DialogContent.BottmBar>
  180. <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
  181. <Button
  182. Width="80"
  183. Height="32"
  184. Command="{Binding CreateCommand}"
  185. Content="Scan"
  186. Style="{StaticResource Btn.cta}" />
  187. <Button
  188. Width="80"
  189. Height="32"
  190. Margin="16,0"
  191. Command="{Binding CancelCommand}"
  192. Content="Cancel"
  193. Style="{StaticResource btn.sec}" />
  194. </StackPanel>
  195. </cus:DialogContent.BottmBar>
  196. </cus:DialogContent>
  197. </UserControl>