NewMessageBox.xaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <Window x:Class="Muchinfo.MTPClient.Infrastructure.MessageBox.NewMessageBox"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. xmlns:resource="clr-namespace:Muchinfo.MTPClient.Resources;assembly=Client.Resources"
  8. xmlns:windows="clr-namespace:Muchinfo.WPF.Controls.Windows;assembly=Client.WPF.Controls"
  9. xmlns:windows1="clr-namespace:Muchinfo.MTPClient.Infrastructure.Windows"
  10. Closed="NewMessageBox_OnClosed"
  11. ShowInTaskbar="False"
  12. Style="{DynamicResource MessageDialogStyle}"
  13. WindowStartupLocation="CenterOwner"
  14. mc:Ignorable="d">
  15. <Window.Resources>
  16. <Style x:Key="MessageDialogCloseButtonStyle" TargetType="{x:Type Button}">
  17. <Setter Property="BorderThickness" Value="0" />
  18. <Setter Property="Padding" Value="4" />
  19. <Setter Property="Height" Value="20" />
  20. <Setter Property="Width" Value="20" />
  21. <Setter Property="Foreground" Value="{DynamicResource MessageDialogCloseButtonBackground}" />
  22. <Setter Property="HorizontalContentAlignment" Value="Center" />
  23. <Setter Property="VerticalContentAlignment" Value="Center" />
  24. <Setter Property="Template">
  25. <Setter.Value>
  26. <ControlTemplate TargetType="{x:Type Button}">
  27. <Border x:Name="ContentContainer"
  28. CornerRadius="2"
  29. Padding="{TemplateBinding Padding}">
  30. <Path Data="M0.5,0.5 L19.5,19.5 M19.5,0.5 L0.5,19.5"
  31. Stretch="Fill"
  32. Stroke="{TemplateBinding Foreground}"
  33. StrokeThickness="2" />
  34. </Border>
  35. <ControlTemplate.Triggers>
  36. <Trigger Property="IsPressed" Value="true">
  37. <Setter TargetName="ContentContainer" Property="Background" Value="{DynamicResource MessageDialogCloseButtonMouseOverBrush}" />
  38. </Trigger>
  39. <Trigger Property="IsMouseOver" Value="True">
  40. <Setter TargetName="ContentContainer" Property="Background" Value="{DynamicResource MessageDialogCloseButtonMouseOverBrush}" />
  41. </Trigger>
  42. <Trigger Property="IsFocused" Value="True">
  43. <Setter TargetName="ContentContainer" Property="Background" Value="{DynamicResource MessageDialogCloseButtonMouseOverBrush}" />
  44. </Trigger>
  45. </ControlTemplate.Triggers>
  46. </ControlTemplate>
  47. </Setter.Value>
  48. </Setter>
  49. </Style>
  50. <Style x:Key="MessageDialogStyle" TargetType="{x:Type Window}">
  51. <Setter Property="AllowsTransparency" Value="True" />
  52. <Setter Property="Background" Value="Transparent" />
  53. <Setter Property="FontFamily" Value="Simsun, Microsoft YaHei" />
  54. <Setter Property="Foreground" Value="{DynamicResource MessageDialogContnetForeground}" />
  55. <Setter Property="FontSize" Value="{DynamicResource MuchinfoFontSize_S}" />
  56. <Setter Property="ResizeMode" Value="NoResize" />
  57. <Setter Property="WindowStyle" Value="None" />
  58. <Setter Property="SnapsToDevicePixels" Value="True" />
  59. <Setter Property="TextOptions.TextFormattingMode" Value="Display" />
  60. <Setter Property="Width" Value="429" />
  61. <Setter Property="Height" Value="249" />
  62. <Setter Property="ShowInTaskbar" Value="True" />
  63. <Setter Property="BorderThickness" Value="1" />
  64. <Setter Property="BorderBrush" Value="{DynamicResource MessageDialogBorderBrush}" />
  65. <Setter Property="Template">
  66. <Setter.Value>
  67. <ControlTemplate TargetType="{x:Type Window}">
  68. <Grid Margin="10">
  69. <!--
  70. <Rectangle RadiusX="2" RadiusY="2">
  71. <Rectangle.Effect>
  72. <DropShadowEffect BlurRadius="10" ShadowDepth="0" />
  73. </Rectangle.Effect>
  74. </Rectangle>
  75. -->
  76. <Rectangle Fill="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
  77. RadiusX="2"
  78. RadiusY="2">
  79. <Rectangle.Effect>
  80. <DropShadowEffect BlurRadius="10" ShadowDepth="0" />
  81. </Rectangle.Effect>
  82. </Rectangle>
  83. <Border Background="{DynamicResource MessageDialogBackground}"
  84. BorderBrush="{TemplateBinding BorderBrush}"
  85. BorderThickness="{TemplateBinding BorderThickness}"
  86. CornerRadius="2"
  87. Padding="{TemplateBinding Margin}"
  88. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
  89. <Grid>
  90. <Grid.RowDefinitions>
  91. <RowDefinition Height="47" />
  92. <RowDefinition Height="1" />
  93. <RowDefinition Height="1" />
  94. <RowDefinition Height="*" />
  95. </Grid.RowDefinitions>
  96. <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
  97. <Border x:Name="brdTitle"
  98. Margin="0,5,0,0"
  99. HorizontalAlignment="Stretch"
  100. VerticalAlignment="Stretch"
  101. Background="Transparent">
  102. <TextBlock HorizontalAlignment="Center"
  103. VerticalAlignment="Center"
  104. FontSize="{DynamicResource MuchinfoFontSize_XL}"
  105. FontWeight="Bold"
  106. Foreground="{DynamicResource MessageDialogTitleForeground}"
  107. Text="{Binding Title,
  108. RelativeSource={RelativeSource FindAncestor,
  109. AncestorType={x:Type Window}}}" />
  110. <i:Interaction.Triggers>
  111. <i:EventTrigger EventName="MouseMove">
  112. <i:InvokeCommandAction Command="{x:Static windows1:DialogWindowCommands.DragMove}" CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
  113. </i:EventTrigger>
  114. </i:Interaction.Triggers>
  115. </Border>
  116. <Button x:Name="btnClose"
  117. Width="20"
  118. Margin="10,2"
  119. HorizontalAlignment="Right"
  120. Command="{x:Static windows1:DialogWindowCommands.Close}"
  121. CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor,
  122. AncestorType={x:Type Window}}}"
  123. IsCancel="True"
  124. Padding="2"
  125. Style="{DynamicResource MessageDialogCloseButtonStyle}" />
  126. </Grid>
  127. <Separator Grid.Row="1"
  128. Margin="20,0"
  129. VerticalAlignment="Bottom"
  130. Panel.ZIndex="10"
  131. BorderBrush="{DynamicResource MessageDialogSeparatorTop}"
  132. Style="{DynamicResource ThinSeparatorStyle}" />
  133. <Separator Grid.Row="2"
  134. Margin="20,0"
  135. VerticalAlignment="Bottom"
  136. Panel.ZIndex="10"
  137. BorderBrush="{DynamicResource MessageDialogSeparatorBottom}"
  138. Style="{DynamicResource ThinSeparatorStyle}" />
  139. <ContentPresenter Grid.Row="3" />
  140. </Grid>
  141. </Border>
  142. </Grid>
  143. </ControlTemplate>
  144. </Setter.Value>
  145. </Setter>
  146. </Style>
  147. </Window.Resources>
  148. <Grid>
  149. <Grid.RowDefinitions>
  150. <RowDefinition Height="*" />
  151. <RowDefinition Height="Auto" />
  152. </Grid.RowDefinitions>
  153. <Grid.ColumnDefinitions>
  154. <ColumnDefinition Width="Auto" />
  155. <ColumnDefinition Width="2*" />
  156. </Grid.ColumnDefinitions>
  157. <Image x:Name="MessageBoxImageButton"
  158. Grid.Row="0"
  159. Grid.Column="0"
  160. Width="50"
  161. Height="50"
  162. Margin="40,5,20,5"
  163. VerticalAlignment="Center"
  164. Source="{DynamicResource MessageBoxInformation}" />
  165. <TextBlock x:Name="MessageText"
  166. Grid.Row="0"
  167. Grid.Column="1"
  168. MaxHeight="100"
  169. Margin="00,5,40,5"
  170. HorizontalAlignment="Left"
  171. VerticalAlignment="Center"
  172. Foreground="{DynamicResource MessageDialogContnetForeground}"
  173. ScrollViewer.VerticalScrollBarVisibility="Auto"
  174. Text="fdsfasfafasfdasfdsfasfasfsdafjdkslafkjsald;fjkdsa;f;lksdafjs;aldjhkghjdklfg;sdjfdsa;lkfjdsa;lfdasfjasd;lfkjsadfjsad;lkfjasd;lfkjsadl;fkasdfkdsjf;lasdkfsajfl;ksfj;saldfksdal;fksdafjsadklfjdslkfsdalfkjsadfasd;lfksadflkskadfjlsk;fsdfklgfjkdghjdklfk;lasfdsfasfafasfdasfdsfasfasfsdafjdkslafkjsald;fjkdsa;f;lksdafjs;aldjhkghjdklfg;sdjfdsa;lkfjdsa;lfdasfjasd;lfkjsadfjsad;lkfjasd;lfkjsadl;fkasdfkdsjf;lasdkfsajfl;ksfj;saldfksdal;fksdafjsadklfjdslkfsdalfkjsadfasd;lfksadflkskadfjlsk;fsdfklgfjkdghjdklfk;lasffasf"
  175. TextWrapping="Wrap" />
  176. <StackPanel Grid.Row="1"
  177. Grid.Column="0"
  178. Grid.ColumnSpan="2"
  179. Margin="0,5,0,20"
  180. HorizontalAlignment="Center"
  181. VerticalAlignment="Center"
  182. Orientation="Horizontal">
  183. <Button x:Name="btnOK"
  184. Width="100"
  185. Height="30"
  186. Background="{DynamicResource MessageDialogButtonBackground}"
  187. BorderBrush="{DynamicResource MessageDialogButtonBorderBrush}"
  188. Content="{x:Static resource:Client_Resource.Button_Ok}"
  189. Foreground="{DynamicResource MessageDialogButtonForeground}"
  190. KeyUp="BtnOK_OnKeyUp"
  191. PreviewMouseLeftButtonUp="BtnOK_OnMouseDown"
  192. Style="{DynamicResource ButtonWithBorderStyle}"
  193. Visibility="Visible" />
  194. <Button Name="btnCancel"
  195. Width="100"
  196. Height="30"
  197. Margin="20,0,0,0"
  198. Background="{DynamicResource MessageDialogButtonBackground}"
  199. BorderBrush="{DynamicResource MessageDialogButtonBorderBrush}"
  200. Click="BtnCancel_OnClick"
  201. Content="{x:Static resource:Client_Resource.Button_Cancel}"
  202. Foreground="{DynamicResource MessageDialogButtonForeground}"
  203. Style="{DynamicResource ButtonWithBorderStyle}" />
  204. </StackPanel>
  205. </Grid>
  206. </Window>