VerifyPassWordDialog.xaml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <UserControl
  2. x:Class="PDF_Office.Views.Dialog.VerifyPassWordDialog"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:dialog="clr-namespace:PDF_Office.ViewModels.Dialog"
  7. xmlns:local="clr-namespace:PDF_Office.Views.Dialog"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:prism="http://prismlibrary.com/"
  10. Width="600"
  11. Height="250"
  12. d:DataContext="{d:DesignInstance Type=dialog:VerifyPassWordDialogViewModel}"
  13. prism:ViewModelLocator.AutoWireViewModel="True"
  14. mc:Ignorable="d">
  15. <prism:Dialog.WindowStyle>
  16. <Style TargetType="{x:Type Window}">
  17. <Setter Property="Title" Value="{Binding Title}" />
  18. <Setter Property="prism:Dialog.WindowStartupLocation" Value="CenterScreen" />
  19. <Setter Property="ShowInTaskbar" Value="False" />
  20. <Setter Property="SizeToContent" Value="WidthAndHeight" />
  21. <Setter Property="Icon">
  22. <Setter.Value>
  23. <!-- 去除系统图片 -->
  24. <DrawingImage />
  25. </Setter.Value>
  26. </Setter>
  27. </Style>
  28. </prism:Dialog.WindowStyle>
  29. <StackPanel VerticalAlignment="Center">
  30. <TextBlock
  31. Margin="20,15"
  32. FontSize="18"
  33. FontWeight="Bold"
  34. Text="Please enter the password to unpass the file" />
  35. <TextBox
  36. Height="32"
  37. Margin="20,0"
  38. VerticalContentAlignment="Center"
  39. FontSize="14"
  40. Text="{Binding Input, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
  41. <TextBox.Style>
  42. <Style TargetType="{x:Type TextBox}">
  43. <Style.Triggers>
  44. <DataTrigger Binding="{Binding ShowWarning}" Value="Visible">
  45. <Setter Property="BorderBrush" Value="Red" />
  46. </DataTrigger>
  47. </Style.Triggers>
  48. </Style>
  49. </TextBox.Style>
  50. </TextBox>
  51. <Grid>
  52. <TextBlock
  53. Name="TxtInput"
  54. Margin="20,10"
  55. HorizontalAlignment="Left"
  56. FontSize="14"
  57. Foreground="Red"
  58. Text="{Binding WarningText}"
  59. Visibility="{Binding ShowWarning}" />
  60. <StackPanel
  61. Margin="20,0"
  62. HorizontalAlignment="Right"
  63. Orientation="Horizontal">
  64. <Button
  65. Name="BtnOK"
  66. Width="120"
  67. Height="32"
  68. Margin="10,10"
  69. Command="{Binding OKCommand}"
  70. Content="OK" />
  71. <Button
  72. Name="BtnCancel"
  73. Width="120"
  74. Height="32"
  75. Margin="10,0,0,0"
  76. Command="{Binding CancelCommand}"
  77. Content="Cancel" />
  78. </StackPanel>
  79. </Grid>
  80. </StackPanel>
  81. </UserControl>