2
0

Workspace.xaml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <Page x:Class="WechatBakTool.Pages.Workspace"
  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:local="clr-namespace:WechatBakTool.Pages"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="720"
  9. Title="Workspace" Background="White">
  10. <Page.Resources>
  11. <Style TargetType="ToggleButton" x:Key="ComboxStyleBtn">
  12. <Setter Property="Template">
  13. <Setter.Value>
  14. <ControlTemplate>
  15. <!--下拉按钮内部背景色-->
  16. <Border x:Name="Back" Background="#2775b6" BorderThickness="1,0,0,0" CornerRadius="0,3,3,0">
  17. <!--下拉按钮内边框-->
  18. <Path Name="PathFill" Fill="White" Width="10" Height="6" StrokeThickness="0" Data="M5,0 L10,10 L0,10 z" RenderTransformOrigin="0.5,0.5" Stretch="Fill">
  19. <Path.RenderTransform>
  20. <TransformGroup>
  21. <ScaleTransform/>
  22. <SkewTransform/>
  23. <RotateTransform Angle="180"/>
  24. <TranslateTransform/>
  25. </TransformGroup>
  26. </Path.RenderTransform>
  27. </Path>
  28. </Border>
  29. <ControlTemplate.Triggers>
  30. <Trigger Property="IsMouseOver" Value="True">
  31. <Setter TargetName="PathFill" Property="Fill" Value="White"></Setter>
  32. </Trigger>
  33. </ControlTemplate.Triggers>
  34. </ControlTemplate>
  35. </Setter.Value>
  36. </Setter>
  37. </Style>
  38. <Style x:Key="ButtonStyle" TargetType="{x:Type Button}">
  39. <Setter Property="Template">
  40. <Setter.Value>
  41. <ControlTemplate TargetType="{x:Type Button}">
  42. <Border Background="{TemplateBinding Background}">
  43. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  44. </Border>
  45. </ControlTemplate>
  46. </Setter.Value>
  47. </Setter>
  48. </Style>
  49. <!--Combox-->
  50. <Style TargetType="ComboBox" x:Key="ComboBoxStyle">
  51. <Setter Property="ItemContainerStyle">
  52. <Setter.Value>
  53. <!--ComBoxItem-->
  54. <Style TargetType="ComboBoxItem">
  55. <Setter Property="MinHeight" Value="22"></Setter>
  56. <Setter Property="MinWidth" Value="60"></Setter>
  57. <Setter Property="Foreground" Value="White"/>
  58. <Setter Property="Template">
  59. <Setter.Value>
  60. <ControlTemplate TargetType="ComboBoxItem">
  61. <Border Name="Back" Background="Transparent" BorderThickness="0,0,0,0">
  62. <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0" ></ContentPresenter>
  63. </Border>
  64. <ControlTemplate.Triggers>
  65. <Trigger Property="IsMouseOver" Value="True">
  66. <Setter TargetName="Back" Property="Background" Value="LightGray"></Setter>
  67. </Trigger>
  68. <!--下拉框背景色-->
  69. <Trigger Property="IsHighlighted" Value="True">
  70. <Setter TargetName="Back" Property="Background" Value="#2775b6"></Setter>
  71. </Trigger>
  72. </ControlTemplate.Triggers>
  73. </ControlTemplate>
  74. </Setter.Value>
  75. </Setter>
  76. </Style>
  77. </Setter.Value>
  78. </Setter>
  79. <Setter Property="Template">
  80. <Setter.Value>
  81. <ControlTemplate TargetType="ComboBox">
  82. <Grid Background="Transparent">
  83. <Grid.ColumnDefinitions>
  84. <ColumnDefinition Width="0.7*"/>
  85. <ColumnDefinition Width="0.3*" MaxWidth="30"/>
  86. </Grid.ColumnDefinitions>
  87. <!--文字区域背景和边线样式-->
  88. <Border Grid.Column="0" BorderThickness="1" BorderBrush="#2775b6" CornerRadius="3,0,0,3">
  89. <Button Name="export" Style="{StaticResource ButtonStyle}" Click="Export_Click" Background="#2775b6" Foreground="White" Grid.Column="0" BorderThickness="0" Content="{TemplateBinding Text}" HorizontalContentAlignment="Left" VerticalContentAlignment="Center" Padding="8,0,0,0" />
  90. </Border>
  91. <!--右侧下拉button设置-->
  92. <Border Grid.Column="1" BorderThickness="0">
  93. <ToggleButton BorderThickness="3" Style="{StaticResource ComboxStyleBtn}" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press"></ToggleButton>
  94. </Border>
  95. <!--弹出popup整体设置-->
  96. <Popup IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" x:Name="Popup" Focusable="False" AllowsTransparency="False" PopupAnimation="Slide" >
  97. <!--弹出popup边框-->
  98. <Border CornerRadius="3" BorderThickness="0" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" x:Name="DropDown" SnapsToDevicePixels="True">
  99. <!--下拉幕布边界背景设置 MaxHeight="{TemplateBinding MaxDropDownHeight}"-->
  100. <ScrollViewer Margin="0,0,0,0" Background="Gray" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" BorderBrush="Gray" BorderThickness="0" >
  101. <!--StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True-->
  102. <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" Background="#BB2775b6" />
  103. </ScrollViewer>
  104. </Border>
  105. </Popup>
  106. </Grid>
  107. </ControlTemplate>
  108. </Setter.Value>
  109. </Setter>
  110. </Style>
  111. <Style x:Key="RepeatButtonTransparent" TargetType="{x:Type RepeatButton}">
  112. <Setter Property="OverridesDefaultStyle" Value="true"/>
  113. <Setter Property="Background" Value="#2775b6"/>
  114. <Setter Property="Focusable" Value="false"/>
  115. <Setter Property="IsTabStop" Value="false"/>
  116. <Setter Property="Template">
  117. <Setter.Value>
  118. <ControlTemplate TargetType="{x:Type RepeatButton}">
  119. <Border Background="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" CornerRadius="4"/>
  120. </ControlTemplate>
  121. </Setter.Value>
  122. </Setter>
  123. </Style>
  124. <!-- 这里是listview滚动条的滑动块部分样式-->
  125. <Style x:Key="ScrollBarThumbVertical" TargetType="{x:Type Thumb}">
  126. <Setter Property="OverridesDefaultStyle" Value="true"/>
  127. <Setter Property="IsTabStop" Value="false"/>
  128. <Setter Property="Template">
  129. <Setter.Value>
  130. <ControlTemplate TargetType="{x:Type Thumb}">
  131. <Border x:Name="rectangle" Background="#BB2775b6" Height="{TemplateBinding Height}" SnapsToDevicePixels="True" Width="{TemplateBinding Width}" CornerRadius="4"/>
  132. <ControlTemplate.Triggers>
  133. <Trigger Property="IsMouseOver" Value="true">
  134. <Setter Property="Background" TargetName="rectangle" Value="#772775b6"/>
  135. </Trigger>
  136. <Trigger Property="IsDragging" Value="true">
  137. <Setter Property="Background" TargetName="rectangle" Value="#772775b6"/>
  138. </Trigger>
  139. </ControlTemplate.Triggers>
  140. </ControlTemplate>
  141. </Setter.Value>
  142. </Setter>
  143. </Style>
  144. <DataTemplate x:Key="ListViewItemContentTemplate">
  145. <Grid Margin="0">
  146. <Image Width="40" Height="40" Margin="10" VerticalAlignment="Top" HorizontalAlignment="Left" Source="{Binding Avatar}" />
  147. <Label Margin="60,8,0,0" FontWeight="Bold" VerticalAlignment="Top" HorizontalAlignment="Left" Content="{Binding NickName}" Width="130"/>
  148. <Label Margin="60,25,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="140" Content="{Binding LastMsg}"/>
  149. </Grid>
  150. </DataTemplate>
  151. <DataTemplate x:Key="MsgText">
  152. <Grid Margin="0">
  153. <Label Margin="60,8,0,0" FontWeight="Bold" VerticalAlignment="Top" Content="{Binding NickName}"/>
  154. <Label Margin="60,25,0,8" VerticalAlignment="Top" HorizontalAlignment="Left" Width="380">
  155. <TextBlock Text="{Binding StrContent}" TextWrapping="Wrap" />
  156. </Label>
  157. </Grid>
  158. </DataTemplate>
  159. <DataTemplate x:Key="MsgImage">
  160. <Grid Margin="0">
  161. <Image Width="40" Height="40" Margin="10" VerticalAlignment="Top" HorizontalAlignment="Left" Source="{Binding Avatar}" />
  162. <Label Margin="60,8,0,0" FontWeight="Bold" VerticalAlignment="Top" HorizontalAlignment="Left" Content="{Binding NickName}" Width="130"/>
  163. <Label Margin="60,25,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="140" Content="{Binding LastMsg}"/>
  164. </Grid>
  165. </DataTemplate>
  166. <DataTemplate x:Key="MsgAudio">
  167. <Grid Margin="0">
  168. <Image Width="40" Height="40" Margin="10" VerticalAlignment="Top" HorizontalAlignment="Left" Source="{Binding Avatar}" />
  169. <Label Margin="60,8,0,0" FontWeight="Bold" VerticalAlignment="Top" HorizontalAlignment="Left" Content="{Binding NickName}" Width="130"/>
  170. <Label Margin="60,25,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="140" Content="{Binding LastMsg}"/>
  171. </Grid>
  172. </DataTemplate>
  173. </Page.Resources>
  174. <Grid>
  175. <TextBox Name="txt_find_user" Padding="10,0" Height="30" VerticalAlignment="Top" VerticalContentAlignment="Center" FontSize="14" HorizontalAlignment="Left" Width="230" BorderThickness="0,0,10,1" BorderBrush="#2775b6" TextChanged="txt_find_user_TextChanged" GotFocus="txt_find_user_GotFocus" Text="{Binding SearchString, Mode=TwoWay}" />
  176. <ListView Margin="0,30,0,0" Background="Transparent" HorizontalAlignment="Left" Width="230" Name="list_users" ItemTemplate="{DynamicResource ListViewItemContentTemplate}" BorderThickness="0,0,1,0" BorderBrush="#2775b6" SelectionChanged="list_users_SelectionChanged" ItemsSource="{Binding Contacts}">
  177. <ListView.Resources>
  178. <Style TargetType="{x:Type ScrollBar}">
  179. <Setter Property="Background" Value="Transparent"/>
  180. <Setter Property="BorderBrush" Value="Transparent"/>
  181. <Setter Property="BorderThickness" Value="0" />
  182. <Setter Property="Template">
  183. <Setter.Value>
  184. <ControlTemplate TargetType="{x:Type ScrollBar}">
  185. <Grid x:Name="Bg" SnapsToDevicePixels="true" Width="8" HorizontalAlignment="Right">
  186. <Grid.RowDefinitions>
  187. <RowDefinition Height="0"/>
  188. <RowDefinition Height="1*"/>
  189. <RowDefinition Height="0"/>
  190. </Grid.RowDefinitions>
  191. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Row="1" CornerRadius="5"/>
  192. <Track x:Name="PART_Track" IsDirectionReversed="true" IsEnabled="{TemplateBinding IsMouseOver}" Grid.Row="1">
  193. <Track.DecreaseRepeatButton>
  194. <RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource RepeatButtonTransparent}" HorizontalAlignment="Right" Width="8"/>
  195. </Track.DecreaseRepeatButton>
  196. <Track.IncreaseRepeatButton>
  197. <RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource RepeatButtonTransparent}" HorizontalAlignment="Right" Width="8"/>
  198. </Track.IncreaseRepeatButton>
  199. <Track.Thumb>
  200. <Thumb Style="{StaticResource ScrollBarThumbVertical}" Width="8" />
  201. </Track.Thumb>
  202. </Track>
  203. </Grid>
  204. </ControlTemplate>
  205. </Setter.Value>
  206. </Setter>
  207. </Style>
  208. </ListView.Resources>
  209. </ListView>
  210. <Label Content="{Binding WXContact.NickName}" HorizontalAlignment="Left" Margin="258,21,0,0" VerticalAlignment="Top"/>
  211. <ListView x:Name="list_msg" Margin="230,60,0,60" Background="Transparent" BorderThickness="0,1,0,1" BorderBrush="#BB2775b6" ItemTemplate="{DynamicResource MsgText}">
  212. </ListView>
  213. <ComboBox Name="cb_export" Width="120" Height="30" Style="{StaticResource ComboBoxStyle}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="30,15" ItemsSource="{Binding ExportItems}" SelectedItem="{Binding SelectExportItem}" DisplayMemberPath="Name" SelectedValuePath="Value" IsEnabled="{Binding SelectContact}" />
  214. <Button x:Name="btn_open_workspace" Width="80" Height="30" Style="{StaticResource ButtonStyle}" Content="打开文件夹" BorderBrush="Transparent" BorderThickness="0" Background="#2775b6" Foreground="White" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,390,15" Click="btn_open_workspace_Click">
  215. <Button.Resources>
  216. <Style TargetType="{x:Type Border}">
  217. <Setter Property="CornerRadius" Value="3"/>
  218. </Style>
  219. </Button.Resources>
  220. </Button>
  221. <Button x:Name="btn_analyse" Width="80" Height="30" Style="{StaticResource ButtonStyle}" Content="旧版消息工具" BorderBrush="Transparent" BorderThickness="0" Background="#2775b6" Foreground="White" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,292,15" Click="btn_analyse_Click" >
  222. <Button.Resources>
  223. <Style TargetType="{x:Type Border}">
  224. <Setter Property="CornerRadius" Value="3"/>
  225. </Style>
  226. </Button.Resources>
  227. </Button>
  228. </Grid>
  229. </Page>