终端一体化运控平台
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

UserConfigView.xaml 71 KiB

2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254
  1. <Window
  2. x:Class="BPASmartClient.CustomResource.Pages.View.UserConfigView"
  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:local="clr-namespace:BPASmartClient.CustomResource.Pages.View"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:vm="clr-namespace:BPASmartClient.CustomResource.Pages.ViewModel"
  9. Title="UserConfigView"
  10. Width="800"
  11. Height="500"
  12. AllowsTransparency="True"
  13. Background="{x:Null}"
  14. Topmost="True"
  15. WindowStartupLocation="CenterScreen"
  16. WindowStyle="None"
  17. mc:Ignorable="d">
  18. <Window.DataContext>
  19. <vm:UserConfigViewModel />
  20. </Window.DataContext>
  21. <Window.Resources>
  22. <ImageBrush x:Key="ImageBrushAddBlue" ImageSource="../../Image/按钮/AddGreen.png" />
  23. <ImageBrush x:Key="ImageBrushAddGray" ImageSource="../../Image/按钮/Delete.png" />
  24. <Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
  25. <Setter Property="SnapsToDevicePixels" Value="True" />
  26. <Setter Property="OverridesDefaultStyle" Value="true" />
  27. <Setter Property="IsTabStop" Value="false" />
  28. <Setter Property="Focusable" Value="false" />
  29. <Setter Property="Template">
  30. <Setter.Value>
  31. <ControlTemplate TargetType="{x:Type RepeatButton}">
  32. <Border Background="Transparent" />
  33. </ControlTemplate>
  34. </Setter.Value>
  35. </Setter>
  36. </Style>
  37. <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
  38. <Setter Property="SnapsToDevicePixels" Value="True" />
  39. <Setter Property="OverridesDefaultStyle" Value="true" />
  40. <Setter Property="IsTabStop" Value="false" />
  41. <Setter Property="Focusable" Value="false" />
  42. <Setter Property="Template">
  43. <Setter.Value>
  44. <ControlTemplate TargetType="{x:Type Thumb}">
  45. <Border
  46. Background="{TemplateBinding Background}"
  47. BorderBrush="{TemplateBinding BorderBrush}"
  48. BorderThickness="1"
  49. CornerRadius="2" />
  50. </ControlTemplate>
  51. </Setter.Value>
  52. </Setter>
  53. </Style>
  54. <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
  55. <Grid>
  56. <Border
  57. Width="0.5"
  58. Background="#FF046BFF"
  59. CornerRadius="2" />
  60. <Track x:Name="PART_Track" IsDirectionReversed="true">
  61. <Track.DecreaseRepeatButton>
  62. <RepeatButton Command="ScrollBar.PageUpCommand" Style="{StaticResource ScrollBarPageButton}" />
  63. </Track.DecreaseRepeatButton>
  64. <Track.Thumb>
  65. <Thumb
  66. Margin="4,0,4,0"
  67. Background="DodgerBlue"
  68. Style="{StaticResource ScrollBarThumb}" />
  69. </Track.Thumb>
  70. <Track.IncreaseRepeatButton>
  71. <RepeatButton Command="ScrollBar.PageDownCommand" Style="{StaticResource ScrollBarPageButton}" />
  72. </Track.IncreaseRepeatButton>
  73. </Track>
  74. </Grid>
  75. </ControlTemplate>
  76. <ControlTemplate x:Key="ScrollViewerControlTemplate1" TargetType="{x:Type ScrollViewer}">
  77. <Grid x:Name="Grid" Background="{TemplateBinding Background}">
  78. <Grid.ColumnDefinitions>
  79. <ColumnDefinition Width="*" />
  80. <ColumnDefinition Width="Auto" />
  81. </Grid.ColumnDefinitions>
  82. <Grid.RowDefinitions>
  83. <RowDefinition Height="*" />
  84. <RowDefinition Height="Auto" />
  85. </Grid.RowDefinitions>
  86. <Rectangle
  87. x:Name="Corner"
  88. Grid.Row="1"
  89. Grid.Column="1"
  90. Fill="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
  91. <ScrollContentPresenter
  92. x:Name="PART_ScrollContentPresenter"
  93. Grid.Row="0"
  94. Grid.Column="0"
  95. Margin="{TemplateBinding Padding}"
  96. CanContentScroll="{TemplateBinding CanContentScroll}"
  97. CanHorizontallyScroll="False"
  98. CanVerticallyScroll="False"
  99. Content="{TemplateBinding Content}"
  100. ContentTemplate="{TemplateBinding ContentTemplate}" />
  101. <ScrollBar
  102. x:Name="PART_VerticalScrollBar"
  103. Grid.Row="0"
  104. Grid.Column="1"
  105. AutomationProperties.AutomationId="VerticalScrollBar"
  106. Cursor="Arrow"
  107. Maximum="{TemplateBinding ScrollableHeight}"
  108. Minimum="0"
  109. Template="{StaticResource VerticalScrollBar}"
  110. ViewportSize="{TemplateBinding ViewportHeight}"
  111. Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
  112. Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
  113. <ScrollBar
  114. x:Name="PART_HorizontalScrollBar"
  115. Grid.Row="1"
  116. Grid.Column="0"
  117. AutomationProperties.AutomationId="HorizontalScrollBar"
  118. Cursor="Arrow"
  119. Maximum="{TemplateBinding ScrollableWidth}"
  120. Minimum="0"
  121. Orientation="Horizontal"
  122. ViewportSize="{TemplateBinding ViewportWidth}"
  123. Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
  124. Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
  125. </Grid>
  126. </ControlTemplate>
  127. <!-- 对象树子模板 -->
  128. <DataTemplate x:Key="TreeItemTemplate" DataType="TreeViewItem">
  129. <Grid Height="28" Margin="50,0,0,0">
  130. <Grid.ColumnDefinitions>
  131. <ColumnDefinition Width="*" />
  132. <ColumnDefinition Width="30" />
  133. </Grid.ColumnDefinitions>
  134. <TextBlock
  135. x:Name="tb_PageName"
  136. Margin="10,0"
  137. HorizontalAlignment="Left"
  138. VerticalAlignment="Center"
  139. FontSize="15"
  140. Foreground="White"
  141. Text="{Binding Name}" />
  142. <Button
  143. x:Name="BtnAdd"
  144. Grid.Column="1"
  145. HorizontalAlignment="Center"
  146. VerticalAlignment="Center"
  147. Background="Transparent"
  148. Command="{Binding DataContext.AddUserPageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=TreeView}}"
  149. CommandParameter="{Binding Path=Text, ElementName=tb_PageName}">
  150. <Button.Template>
  151. <ControlTemplate TargetType="Button">
  152. <Grid>
  153. <Rectangle
  154. x:Name="BtnRetangle"
  155. Width="20"
  156. Height="20"
  157. HorizontalAlignment="Center"
  158. VerticalAlignment="Center"
  159. Fill="{StaticResource ImageBrushAddBlue}"
  160. Stroke="Transparent"
  161. StrokeThickness="1" />
  162. <ContentPresenter
  163. HorizontalAlignment="Center"
  164. VerticalAlignment="Center"
  165. Content="{TemplateBinding Content}" />
  166. </Grid>
  167. <ControlTemplate.Triggers>
  168. <Trigger Property="IsMouseOver" Value="True">
  169. <Setter TargetName="BtnRetangle" Property="Height" Value="22" />
  170. <Setter TargetName="BtnRetangle" Property="Width" Value="22" />
  171. </Trigger>
  172. <DataTrigger Binding="{Binding IsChecked}" Value="true">
  173. <Setter TargetName="BtnRetangle" Property="Fill" Value="{StaticResource ImageBrushAddGray}" />
  174. <Setter Property="ToolTip" Value="已添加" />
  175. </DataTrigger>
  176. <DataTrigger Binding="{Binding IsChecked}" Value="false">
  177. <Setter TargetName="BtnRetangle" Property="Fill" Value="{StaticResource ImageBrushAddBlue}" />
  178. <Setter Property="ToolTip" Value="添加" />
  179. </DataTrigger>
  180. </ControlTemplate.Triggers>
  181. </ControlTemplate>
  182. </Button.Template>
  183. </Button>
  184. </Grid>
  185. </DataTemplate>
  186. <Style TargetType="TreeViewItem">
  187. <Setter Property="Background" Value="Transparent" />
  188. <Setter Property="IsExpanded" Value="True" />
  189. <Setter Property="HeaderTemplate">
  190. <Setter.Value>
  191. <HierarchicalDataTemplate ItemTemplate="{StaticResource TreeItemTemplate}" ItemsSource="{Binding TreeViewItems, Mode=TwoWay}">
  192. <StackPanel
  193. Height="28"
  194. HorizontalAlignment="Left"
  195. VerticalAlignment="Center"
  196. Orientation="Horizontal">
  197. <!-- Image Source="folder.png" VerticalAlignment="Center" Height="17" Margin="10,0"/> -->
  198. <TextBlock
  199. Margin="5,0,0,0"
  200. VerticalAlignment="Center"
  201. FontSize="15"
  202. Foreground="White"
  203. Text="{Binding Name}" />
  204. </StackPanel>
  205. </HierarchicalDataTemplate>
  206. </Setter.Value>
  207. </Setter>
  208. <Setter Property="Template">
  209. <Setter.Value>
  210. <ControlTemplate TargetType="{x:Type TreeViewItem}">
  211. <Grid>
  212. <Grid.ColumnDefinitions>
  213. <ColumnDefinition Width="Auto" />
  214. <ColumnDefinition Width="*" />
  215. </Grid.ColumnDefinitions>
  216. <Grid.RowDefinitions>
  217. <RowDefinition Height="Auto" />
  218. <RowDefinition />
  219. </Grid.RowDefinitions>
  220. <Border
  221. x:Name="Bd"
  222. Grid.Column="0"
  223. Padding="{TemplateBinding Padding}"
  224. Background="{TemplateBinding Background}"
  225. BorderBrush="{TemplateBinding BorderBrush}"
  226. BorderThickness="{TemplateBinding BorderThickness}">
  227. <ContentPresenter
  228. x:Name="PART_Header"
  229. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  230. ContentSource="Header" />
  231. </Border>
  232. <ItemsPresenter
  233. x:Name="ItemsHost"
  234. Grid.Row="1"
  235. Grid.Column="0"
  236. Grid.ColumnSpan="2"
  237. Visibility="Collapsed" />
  238. <VisualStateManager.VisualStateGroups>
  239. <VisualStateGroup x:Name="SelectionStates">
  240. <VisualState x:Name="Selected">
  241. <Storyboard>
  242. <ColorAnimationUsingKeyFrames Storyboard.TargetName="Bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
  243. <EasingColorKeyFrame KeyTime="0" Value="Transparent" />
  244. </ColorAnimationUsingKeyFrames>
  245. </Storyboard>
  246. </VisualState>
  247. <VisualState x:Name="Unselected" />
  248. <VisualState x:Name="SelectedInactive">
  249. <Storyboard>
  250. <ColorAnimationUsingKeyFrames Storyboard.TargetName="Bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
  251. <EasingColorKeyFrame KeyTime="0" Value="Transparent" />
  252. </ColorAnimationUsingKeyFrames>
  253. </Storyboard>
  254. </VisualState>
  255. </VisualStateGroup>
  256. <VisualStateGroup x:Name="ExpansionStates">
  257. <VisualState x:Name="Expanded">
  258. <Storyboard>
  259. <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemsHost" Storyboard.TargetProperty="(UIElement.Visibility)">
  260. <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
  261. </ObjectAnimationUsingKeyFrames>
  262. </Storyboard>
  263. </VisualState>
  264. <VisualState x:Name="Collapsed" />
  265. </VisualStateGroup>
  266. </VisualStateManager.VisualStateGroups>
  267. </Grid>
  268. <ControlTemplate.Triggers>
  269. <MultiTrigger>
  270. <MultiTrigger.Conditions>
  271. <Condition Property="HasHeader" Value="false" />
  272. <Condition Property="Width" Value="Auto" />
  273. </MultiTrigger.Conditions>
  274. <Setter TargetName="PART_Header" Property="MinWidth" Value="75" />
  275. </MultiTrigger>
  276. <MultiTrigger>
  277. <MultiTrigger.Conditions>
  278. <Condition Property="HasHeader" Value="false" />
  279. <Condition Property="Height" Value="Auto" />
  280. </MultiTrigger.Conditions>
  281. <Setter TargetName="PART_Header" Property="MinHeight" Value="19" />
  282. </MultiTrigger>
  283. </ControlTemplate.Triggers>
  284. </ControlTemplate>
  285. </Setter.Value>
  286. </Setter>
  287. </Style>
  288. <Style x:Key="ItemContainer" TargetType="{x:Type ListBoxItem}">
  289. <Setter Property="Template">
  290. <Setter.Value>
  291. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  292. <Border
  293. x:Name="IconBorder"
  294. Background="Transparent"
  295. BorderThickness="0"
  296. CornerRadius="4">
  297. <ContentPresenter />
  298. </Border>
  299. <ControlTemplate.Triggers>
  300. <Trigger Property="IsSelected" Value="true">
  301. <Setter TargetName="IconBorder" Property="BitmapEffect">
  302. <Setter.Value>
  303. <OuterGlowBitmapEffect GlowColor="Transparent" GlowSize="5" />
  304. </Setter.Value>
  305. </Setter>
  306. </Trigger>
  307. </ControlTemplate.Triggers>
  308. </ControlTemplate>
  309. </Setter.Value>
  310. </Setter>
  311. </Style>
  312. <!-- 切换button -->
  313. <Style x:Key="changebutton_local" TargetType="Button">
  314. <Setter Property="Height" Value="32" />
  315. <Setter Property="Width" Value="130" />
  316. <Setter Property="FontSize" Value="18" />
  317. <Setter Property="Foreground" Value="White" />
  318. <Setter Property="Template">
  319. <Setter.Value>
  320. <ControlTemplate TargetType="Button">
  321. <Border
  322. x:Name="border"
  323. BorderBrush="White"
  324. BorderThickness="0"
  325. SnapsToDevicePixels="True">
  326. <Border.Background>
  327. <DrawingBrush>
  328. <DrawingBrush.Drawing>
  329. <GeometryDrawing Brush="#009DFF">
  330. <GeometryDrawing.Pen>
  331. <Pen
  332. x:Name="pen"
  333. Brush="{TemplateBinding BorderBrush}"
  334. Thickness="3" />
  335. </GeometryDrawing.Pen>
  336. <GeometryDrawing.Geometry>
  337. <PathGeometry Figures="m-70 -80 L200 -80 L200 80 L70 80 L-70 80 A 10,10 0 0 1 -80,70 L-80 70 L-80 -70 A 10,10 0 0 1 -70,-80" />
  338. </GeometryDrawing.Geometry>
  339. </GeometryDrawing>
  340. </DrawingBrush.Drawing>
  341. </DrawingBrush>
  342. </Border.Background>
  343. <TextBlock
  344. Margin="0,5,0,0"
  345. HorizontalAlignment="Center"
  346. VerticalAlignment="Top"
  347. Foreground="{TemplateBinding Foreground}"
  348. Text="{TemplateBinding Content}" />
  349. </Border>
  350. <ControlTemplate.Triggers>
  351. <Trigger Property="IsMouseOver" Value="True" />
  352. <DataTrigger Binding="{Binding IsChecked}" Value="true">
  353. <Setter Property="Height" Value="43" />
  354. <Setter Property="Width" Value="133" />
  355. <Setter Property="Effect">
  356. <Setter.Value>
  357. <DropShadowEffect
  358. Direction="220"
  359. Opacity="1"
  360. ShadowDepth="15"
  361. Color="Black" />
  362. </Setter.Value>
  363. </Setter>
  364. <Setter TargetName="border" Property="Background">
  365. <Setter.Value>
  366. <DrawingBrush>
  367. <DrawingBrush.Drawing>
  368. <GeometryDrawing Brush="#009DFF">
  369. <GeometryDrawing.Pen>
  370. <Pen Brush="White" Thickness="5" />
  371. </GeometryDrawing.Pen>
  372. <GeometryDrawing.Geometry>
  373. <PathGeometry Figures="m-70 -80 L200 -80 L200 80 L200 80 L50 80 L60 130 L70 80 L-70 80 A 10,10 0 0 1 -80,70 L-80 70 L-80 -70 A 10,10 0 0 1 -70,-80" />
  374. </GeometryDrawing.Geometry>
  375. </GeometryDrawing>
  376. </DrawingBrush.Drawing>
  377. </DrawingBrush>
  378. </Setter.Value>
  379. </Setter>
  380. </DataTrigger>
  381. </ControlTemplate.Triggers>
  382. </ControlTemplate>
  383. </Setter.Value>
  384. </Setter>
  385. <Style.Triggers />
  386. </Style>
  387. <Style x:Key="changebutton_device" TargetType="Button">
  388. <Setter Property="Height" Value="32" />
  389. <Setter Property="Width" Value="130" />
  390. <Setter Property="FontSize" Value="18" />
  391. <Setter Property="Foreground" Value="White" />
  392. <Setter Property="Template">
  393. <Setter.Value>
  394. <ControlTemplate TargetType="Button">
  395. <Border
  396. x:Name="border"
  397. BorderBrush="White"
  398. BorderThickness="0"
  399. SnapsToDevicePixels="True">
  400. <Border.Background>
  401. <DrawingBrush>
  402. <DrawingBrush.Drawing>
  403. <GeometryDrawing Brush="#009DFF">
  404. <GeometryDrawing.Pen>
  405. <Pen
  406. x:Name="pen"
  407. Brush="{TemplateBinding BorderBrush}"
  408. Thickness="3" />
  409. </GeometryDrawing.Pen>
  410. <GeometryDrawing.Geometry>
  411. <PathGeometry Figures="m-70 -80 L200 -80 L200 80 L70 80 L-70 80 A 10,10 0 0 1 -80,70 L-80 70 L-80 -70 A 10,10 0 0 1 -70,-80" />
  412. </GeometryDrawing.Geometry>
  413. </GeometryDrawing>
  414. </DrawingBrush.Drawing>
  415. </DrawingBrush>
  416. </Border.Background>
  417. <TextBlock
  418. Margin="0,5,0,0"
  419. HorizontalAlignment="Center"
  420. VerticalAlignment="Top"
  421. Foreground="{TemplateBinding Foreground}"
  422. Text="{TemplateBinding Content}" />
  423. </Border>
  424. <ControlTemplate.Triggers>
  425. <Trigger Property="IsMouseOver" Value="True" />
  426. <DataTrigger Binding="{Binding IsChecked}" Value="false">
  427. <Setter Property="Height" Value="43" />
  428. <Setter Property="Width" Value="133" />
  429. <Setter Property="Effect">
  430. <Setter.Value>
  431. <DropShadowEffect
  432. Direction="220"
  433. Opacity="1"
  434. ShadowDepth="15"
  435. Color="Black" />
  436. </Setter.Value>
  437. </Setter>
  438. <Setter TargetName="border" Property="Background">
  439. <Setter.Value>
  440. <DrawingBrush>
  441. <DrawingBrush.Drawing>
  442. <GeometryDrawing Brush="#009DFF">
  443. <GeometryDrawing.Pen>
  444. <Pen Brush="White" Thickness="5" />
  445. </GeometryDrawing.Pen>
  446. <GeometryDrawing.Geometry>
  447. <PathGeometry Figures="m-70 -80 L200 -80 L200 80 L200 80 L50 80 L60 130 L70 80 L-70 80 A 10,10 0 0 1 -80,70 L-80 70 L-80 -70 A 10,10 0 0 1 -70,-80" />
  448. </GeometryDrawing.Geometry>
  449. </GeometryDrawing>
  450. </DrawingBrush.Drawing>
  451. </DrawingBrush>
  452. </Setter.Value>
  453. </Setter>
  454. </DataTrigger>
  455. </ControlTemplate.Triggers>
  456. </ControlTemplate>
  457. </Setter.Value>
  458. </Setter>
  459. </Style>
  460. <Style x:Key="closeBtn" TargetType="Button">
  461. <Setter Property="Background" Value="Transparent" />
  462. <Setter Property="Template">
  463. <Setter.Value>
  464. <ControlTemplate TargetType="Button">
  465. <Grid Name="gr">
  466. <TextBlock
  467. HorizontalAlignment="Center"
  468. VerticalAlignment="Center"
  469. FontFamily="../../Fonts/#iconfont"
  470. FontSize="30"
  471. Foreground="White"
  472. Text="&#xe8e7;" />
  473. </Grid>
  474. <ControlTemplate.Triggers>
  475. <Trigger Property="IsMouseOver" Value="True">
  476. <Setter TargetName="gr" Property="Background" Value="#22009DFF" />
  477. </Trigger>
  478. </ControlTemplate.Triggers>
  479. </ControlTemplate>
  480. </Setter.Value>
  481. </Setter>
  482. </Style>
  483. <Style x:Key="btn" TargetType="Button">
  484. <Setter Property="Template">
  485. <Setter.Value>
  486. <ControlTemplate TargetType="Button">
  487. <Border
  488. Name="gr"
  489. Background="{TemplateBinding Background}"
  490. CornerRadius="5"
  491. Opacity="0.8">
  492. <ContentPresenter
  493. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  494. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  495. Content="{TemplateBinding Content}" />
  496. </Border>
  497. <ControlTemplate.Triggers>
  498. <Trigger Property="IsMouseOver" Value="True">
  499. <Setter TargetName="gr" Property="Opacity" Value="1" />
  500. </Trigger>
  501. </ControlTemplate.Triggers>
  502. </ControlTemplate>
  503. </Setter.Value>
  504. </Setter>
  505. </Style>
  506. </Window.Resources>
  507. <Border
  508. x:Name="br"
  509. Background="Transparent"
  510. BorderBrush="#064d87"
  511. BorderThickness="2">
  512. <Border.Effect>
  513. <DropShadowEffect
  514. BlurRadius="10"
  515. ShadowDepth="1"
  516. Color="#009DFF" />
  517. </Border.Effect>
  518. <Grid Background="#061c43">
  519. <!--<Image Source="../../Image/权限背景.png" Stretch="Fill" />-->
  520. <Grid Background="Transparent">
  521. <Grid.RowDefinitions>
  522. <RowDefinition Height="40" />
  523. <RowDefinition Height="20" />
  524. <RowDefinition />
  525. <RowDefinition Height="60" />
  526. <!--<RowDefinition Height="13*" />
  527. <RowDefinition Height="50" />
  528. <RowDefinition Height="5" />-->
  529. </Grid.RowDefinitions>
  530. <Border BorderBrush="#064d87" BorderThickness="0,0,0,2">
  531. <Border.Background>
  532. <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
  533. <GradientStop Color="#064d87" />
  534. <GradientStop Offset="1" Color="#99064d87" />
  535. </LinearGradientBrush>
  536. </Border.Background>
  537. </Border>
  538. <Button
  539. Width="40"
  540. HorizontalAlignment="Right"
  541. HorizontalContentAlignment="Center"
  542. VerticalContentAlignment="Center"
  543. Command="{Binding CancelCommand}"
  544. Style="{StaticResource closeBtn}" />
  545. <!--<TextBlock
  546. Margin="0,0,10,0"
  547. HorizontalAlignment="Right"
  548. VerticalAlignment="Center"
  549. FontFamily="../../Fonts/#iconfont"
  550. FontSize="30"
  551. Foreground="White"
  552. Text="&#xe8e7;" />-->
  553. <StackPanel
  554. HorizontalAlignment="Center"
  555. VerticalAlignment="Center"
  556. Orientation="Horizontal">
  557. <TextBlock
  558. HorizontalAlignment="Center"
  559. FontSize="24"
  560. Foreground="#ddd"
  561. Text="{Binding UserName}" />
  562. <TextBlock
  563. Margin="10,0,0,0"
  564. HorizontalAlignment="Center"
  565. FontSize="24"
  566. Foreground="#ddd"
  567. Text="权限分配" />
  568. </StackPanel>
  569. <!--<TextBlock
  570. Grid.Row="1"
  571. Margin="10,0,0,0"
  572. HorizontalAlignment="Center"
  573. VerticalAlignment="Top"
  574. FontSize="20"
  575. Foreground="#ddd"
  576. Text="页面权限分配" />-->
  577. <!--<TextBlock
  578. Grid.Row="3"
  579. Margin="10,0,0,0"
  580. HorizontalAlignment="Center"
  581. VerticalAlignment="Center"
  582. FontSize="20"
  583. Foreground="#ddd"
  584. Text="配料权限分配" />-->
  585. <Grid Grid.Row="2">
  586. <Grid.ColumnDefinitions>
  587. <ColumnDefinition Width="50" />
  588. <ColumnDefinition Width="*" />
  589. <ColumnDefinition Width="120" />
  590. <ColumnDefinition Width="*" />
  591. <ColumnDefinition Width="50" />
  592. </Grid.ColumnDefinitions>
  593. <TextBlock
  594. Grid.Column="0"
  595. Width="20"
  596. HorizontalAlignment="Center"
  597. VerticalAlignment="Center"
  598. FontSize="20"
  599. Foreground="#ddd"
  600. Text="权限列表"
  601. TextWrapping="Wrap" />
  602. <TextBlock
  603. Grid.Column="4"
  604. Width="20"
  605. HorizontalAlignment="Center"
  606. VerticalAlignment="Center"
  607. FontSize="20"
  608. Foreground="#ddd"
  609. Text="当前用户权限"
  610. TextWrapping="Wrap" />
  611. <!--#region 页面权限-->
  612. <Border
  613. Grid.Column="1"
  614. BorderBrush="#1874CD"
  615. BorderThickness="1" />
  616. <Border
  617. Grid.Column="3"
  618. BorderBrush="#1874CD"
  619. BorderThickness="1" />
  620. <ScrollViewer
  621. Grid.Column="1"
  622. Margin="20,5,5,5"
  623. CanContentScroll="True"
  624. Template="{StaticResource ScrollViewerControlTemplate1}">
  625. <TreeView
  626. x:Name="MyTreeView"
  627. HorizontalAlignment="Stretch"
  628. Background="Transparent"
  629. BorderBrush="Transparent"
  630. ItemsSource="{Binding pageTreeViewModels}"
  631. ScrollViewer.VerticalScrollBarVisibility="Disabled" />
  632. </ScrollViewer>
  633. <ScrollViewer
  634. Grid.Column="3"
  635. Margin="10,0,10,0"
  636. CanContentScroll="True"
  637. Template="{StaticResource ScrollViewerControlTemplate1}">
  638. <ListBox
  639. x:Name="RightListBox"
  640. Grid.Column="3"
  641. Background="Transparent"
  642. FocusVisualStyle="{x:Null}"
  643. ItemContainerStyle="{StaticResource ItemContainer}"
  644. ItemsSource="{Binding SelectePage}">
  645. <ListBox.Template>
  646. <ControlTemplate>
  647. <StackPanel Background="Transparent" IsItemsHost="True" />
  648. </ControlTemplate>
  649. </ListBox.Template>
  650. <ListBox.ItemTemplate>
  651. <DataTemplate>
  652. <Grid Height="28" Margin="10">
  653. <Grid.ColumnDefinitions>
  654. <ColumnDefinition Width="*" />
  655. <ColumnDefinition Width="60" />
  656. </Grid.ColumnDefinitions>
  657. <TextBlock
  658. x:Name="tb_Name"
  659. HorizontalAlignment="Left"
  660. VerticalAlignment="Center"
  661. FontSize="15"
  662. Foreground="White"
  663. Text="{Binding Name}" />
  664. <Button
  665. x:Name="BtnDelete"
  666. Grid.Column="1"
  667. HorizontalAlignment="Left"
  668. VerticalAlignment="Center"
  669. Background="Transparent"
  670. Command="{Binding DataContext.DeleteUserPageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
  671. CommandParameter="{Binding Path=Text, ElementName=tb_Name}"
  672. ToolTip="移除">
  673. <Button.Template>
  674. <ControlTemplate TargetType="Button">
  675. <Grid>
  676. <Rectangle
  677. x:Name="BtnRetangle"
  678. Width="17"
  679. Height="17"
  680. HorizontalAlignment="Left"
  681. VerticalAlignment="Center"
  682. Stroke="Transparent"
  683. StrokeThickness="1">
  684. <Rectangle.Fill>
  685. <ImageBrush ImageSource="../../Image/按钮/Delete.png" />
  686. </Rectangle.Fill>
  687. </Rectangle>
  688. <ContentPresenter
  689. HorizontalAlignment="Center"
  690. VerticalAlignment="Center"
  691. Content="{TemplateBinding Content}" />
  692. </Grid>
  693. <ControlTemplate.Triggers>
  694. <Trigger Property="IsMouseOver" Value="True">
  695. <Setter TargetName="BtnRetangle" Property="Height" Value="19" />
  696. <Setter TargetName="BtnRetangle" Property="Width" Value="19" />
  697. </Trigger>
  698. </ControlTemplate.Triggers>
  699. </ControlTemplate>
  700. </Button.Template>
  701. </Button>
  702. </Grid>
  703. </DataTemplate>
  704. </ListBox.ItemTemplate>
  705. </ListBox>
  706. </ScrollViewer>
  707. <StackPanel
  708. Grid.Column="2"
  709. HorizontalAlignment="Center"
  710. VerticalAlignment="Center">
  711. <Button
  712. Width="100"
  713. Height="40"
  714. Margin="10,20"
  715. Background="#064d87"
  716. Command="{Binding AddAllCommand}"
  717. CommandParameter="page"
  718. Content="全部添加"
  719. FontSize="16"
  720. Foreground="White"
  721. Style="{StaticResource btn}" />
  722. <Button
  723. Width="100"
  724. Height="40"
  725. Margin="10,20"
  726. Background="#064d87"
  727. Command="{Binding DeleteAllCommand}"
  728. CommandParameter="page"
  729. Content="全部移除"
  730. FontSize="16"
  731. Foreground="White"
  732. Style="{StaticResource btn}" />
  733. </StackPanel>
  734. <!--#endregion-->
  735. </Grid>
  736. <Grid Grid.Row="4" Visibility="Collapsed">
  737. <Grid.ColumnDefinitions>
  738. <ColumnDefinition Width="50" />
  739. <ColumnDefinition Width="*" />
  740. <ColumnDefinition Width="100" />
  741. <ColumnDefinition Width="*" />
  742. <ColumnDefinition Width="50" />
  743. </Grid.ColumnDefinitions>
  744. <Grid.RowDefinitions>
  745. <RowDefinition Height="60" />
  746. <RowDefinition Height="*" />
  747. </Grid.RowDefinitions>
  748. <TextBlock
  749. Grid.Row="1"
  750. Width="20"
  751. HorizontalAlignment="Center"
  752. VerticalAlignment="Center"
  753. FontSize="20"
  754. Foreground="#ddd"
  755. Text="权限列表"
  756. TextWrapping="Wrap" />
  757. <TextBlock
  758. Grid.Row="1"
  759. Grid.Column="4"
  760. Width="20"
  761. HorizontalAlignment="Center"
  762. VerticalAlignment="Center"
  763. FontSize="20"
  764. Foreground="#ddd"
  765. Text="当前用户权限"
  766. TextWrapping="Wrap" />
  767. <Button
  768. Grid.Column="1"
  769. HorizontalAlignment="Right"
  770. Command="{Binding ChangeMaterailPageCommand}"
  771. CommandParameter="Local"
  772. Content="本地原料"
  773. Style="{DynamicResource changebutton_local}" />
  774. <Button
  775. Grid.Column="3"
  776. HorizontalAlignment="Left"
  777. Command="{Binding ChangeMaterailPageCommand}"
  778. CommandParameter="Device"
  779. Content="设备原料"
  780. Style="{DynamicResource changebutton_device}" />
  781. <!--#region 本地原料权限-->
  782. <Border
  783. Grid.Row="1"
  784. Grid.Column="1"
  785. Grid.ColumnSpan="3"
  786. BorderBrush="#1874CD"
  787. BorderThickness="1"
  788. Visibility="{Binding VisibilityLocal}">
  789. <Grid Margin="5">
  790. <Grid.ColumnDefinitions>
  791. <ColumnDefinition Width="*" />
  792. <ColumnDefinition Width="100" />
  793. <ColumnDefinition Width="*" />
  794. </Grid.ColumnDefinitions>
  795. <Border
  796. Grid.Column="0"
  797. BorderBrush="#1874CD"
  798. BorderThickness="1" />
  799. <Border
  800. Grid.Column="2"
  801. BorderBrush="#1874CD"
  802. BorderThickness="1" />
  803. <ScrollViewer
  804. Width="230"
  805. Margin="20,5,5,5"
  806. HorizontalAlignment="Right"
  807. CanContentScroll="True"
  808. Template="{StaticResource ScrollViewerControlTemplate1}">
  809. <ListBox
  810. Background="Transparent"
  811. FocusVisualStyle="{x:Null}"
  812. ItemContainerStyle="{StaticResource ItemContainer}"
  813. ItemsSource="{Binding LoaclMaterails}">
  814. <ListBox.Template>
  815. <ControlTemplate>
  816. <StackPanel Background="Transparent" IsItemsHost="True" />
  817. </ControlTemplate>
  818. </ListBox.Template>
  819. <ListBox.ItemTemplate>
  820. <DataTemplate>
  821. <Grid Height="28" Margin="5">
  822. <Grid.ColumnDefinitions>
  823. <ColumnDefinition Width="*" />
  824. <ColumnDefinition Width="60" />
  825. </Grid.ColumnDefinitions>
  826. <TextBlock
  827. x:Name="tb_Name"
  828. HorizontalAlignment="Left"
  829. VerticalAlignment="Center"
  830. FontSize="15"
  831. Foreground="White"
  832. Text="{Binding RawMaterialName}" />
  833. <Button
  834. x:Name="BtnDelete"
  835. Grid.Column="1"
  836. HorizontalAlignment="Left"
  837. VerticalAlignment="Center"
  838. Background="Transparent"
  839. Command="{Binding DataContext.AddLoaclMaterialCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
  840. CommandParameter="{Binding Path=Text, ElementName=tb_Name}"
  841. ToolTip="移除">
  842. <Button.Template>
  843. <ControlTemplate TargetType="Button">
  844. <Grid>
  845. <Rectangle
  846. x:Name="BtnRetangle"
  847. Width="17"
  848. Height="17"
  849. HorizontalAlignment="Left"
  850. VerticalAlignment="Center"
  851. Stroke="Transparent"
  852. StrokeThickness="1">
  853. <Rectangle.Fill>
  854. <ImageBrush ImageSource="../../Image/按钮/AddGreen.png" />
  855. </Rectangle.Fill>
  856. </Rectangle>
  857. <ContentPresenter
  858. HorizontalAlignment="Center"
  859. VerticalAlignment="Center"
  860. Content="{TemplateBinding Content}" />
  861. </Grid>
  862. <ControlTemplate.Triggers>
  863. <Trigger Property="IsMouseOver" Value="True">
  864. <Setter TargetName="BtnRetangle" Property="Height" Value="19" />
  865. <Setter TargetName="BtnRetangle" Property="Width" Value="19" />
  866. </Trigger>
  867. </ControlTemplate.Triggers>
  868. </ControlTemplate>
  869. </Button.Template>
  870. </Button>
  871. </Grid>
  872. </DataTemplate>
  873. </ListBox.ItemTemplate>
  874. </ListBox>
  875. </ScrollViewer>
  876. <ScrollViewer
  877. Grid.Column="2"
  878. Margin="10,0,10,0"
  879. CanContentScroll="True"
  880. Template="{StaticResource ScrollViewerControlTemplate1}">
  881. <ListBox
  882. Width="230"
  883. Background="Transparent"
  884. FocusVisualStyle="{x:Null}"
  885. ItemContainerStyle="{StaticResource ItemContainer}"
  886. ItemsSource="{Binding UserLoaclMaterails}">
  887. <ListBox.Template>
  888. <ControlTemplate>
  889. <StackPanel Background="Transparent" IsItemsHost="True" />
  890. </ControlTemplate>
  891. </ListBox.Template>
  892. <ListBox.ItemTemplate>
  893. <DataTemplate>
  894. <Grid Height="28" Margin="5">
  895. <Grid.ColumnDefinitions>
  896. <ColumnDefinition Width="*" />
  897. <ColumnDefinition Width="60" />
  898. </Grid.ColumnDefinitions>
  899. <TextBlock
  900. x:Name="tb_Name"
  901. HorizontalAlignment="Left"
  902. VerticalAlignment="Center"
  903. FontSize="15"
  904. Foreground="White"
  905. Text="{Binding RawMaterialName}" />
  906. <Button
  907. x:Name="BtnDelete"
  908. Grid.Column="1"
  909. HorizontalAlignment="Left"
  910. VerticalAlignment="Center"
  911. Background="Transparent"
  912. Command="{Binding DataContext.DeleteLoaclMaterialCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
  913. CommandParameter="{Binding Path=Text, ElementName=tb_Name}"
  914. ToolTip="移除">
  915. <Button.Template>
  916. <ControlTemplate TargetType="Button">
  917. <Grid>
  918. <Rectangle
  919. x:Name="BtnRetangle"
  920. Width="17"
  921. Height="17"
  922. HorizontalAlignment="Left"
  923. VerticalAlignment="Center"
  924. Stroke="Transparent"
  925. StrokeThickness="1">
  926. <Rectangle.Fill>
  927. <ImageBrush ImageSource="../../Image/按钮/Delete.png" />
  928. </Rectangle.Fill>
  929. </Rectangle>
  930. <ContentPresenter
  931. HorizontalAlignment="Center"
  932. VerticalAlignment="Center"
  933. Content="{TemplateBinding Content}" />
  934. </Grid>
  935. <ControlTemplate.Triggers>
  936. <Trigger Property="IsMouseOver" Value="True">
  937. <Setter TargetName="BtnRetangle" Property="Height" Value="19" />
  938. <Setter TargetName="BtnRetangle" Property="Width" Value="19" />
  939. </Trigger>
  940. </ControlTemplate.Triggers>
  941. </ControlTemplate>
  942. </Button.Template>
  943. </Button>
  944. </Grid>
  945. </DataTemplate>
  946. </ListBox.ItemTemplate>
  947. </ListBox>
  948. </ScrollViewer>
  949. <StackPanel
  950. Grid.Column="1"
  951. HorizontalAlignment="Center"
  952. VerticalAlignment="Center">
  953. <Button
  954. Width="70"
  955. Height="50"
  956. Margin="10,20"
  957. Background="#009DFF"
  958. Command="{Binding AddAllCommand}"
  959. CommandParameter="local"
  960. FontSize="16"
  961. Foreground="White">
  962. <TextBlock Text="全部 添加" TextWrapping="Wrap" />
  963. </Button>
  964. <Button
  965. Width="70"
  966. Height="50"
  967. Margin="10,20"
  968. Background="#009DFF"
  969. Command="{Binding DeleteAllCommand}"
  970. CommandParameter="local"
  971. FontSize="16"
  972. Foreground="White">
  973. <TextBlock Text="全部 移除" TextWrapping="Wrap" />
  974. </Button>
  975. </StackPanel>
  976. </Grid>
  977. </Border>
  978. <!--#endregion-->
  979. <!--#region 设备原料权限-->
  980. <Border
  981. Grid.Row="1"
  982. Grid.Column="1"
  983. Grid.ColumnSpan="3"
  984. BorderBrush="#1874CD"
  985. BorderThickness="1"
  986. Visibility="{Binding VisibilityDevice}">
  987. <Grid Margin="5">
  988. <Grid.ColumnDefinitions>
  989. <ColumnDefinition Width="*" />
  990. <ColumnDefinition Width="100" />
  991. <ColumnDefinition Width="*" />
  992. </Grid.ColumnDefinitions>
  993. <Border
  994. Grid.Column="0"
  995. BorderBrush="#1874CD"
  996. BorderThickness="1" />
  997. <Border
  998. Grid.Column="2"
  999. BorderBrush="#1874CD"
  1000. BorderThickness="1" />
  1001. <ScrollViewer
  1002. Width="230"
  1003. Margin="20,5,5,5"
  1004. HorizontalAlignment="Right"
  1005. CanContentScroll="True"
  1006. Template="{StaticResource ScrollViewerControlTemplate1}">
  1007. <ListBox
  1008. Background="Transparent"
  1009. FocusVisualStyle="{x:Null}"
  1010. ItemContainerStyle="{StaticResource ItemContainer}"
  1011. ItemsSource="{Binding DeviceMaterails}">
  1012. <ListBox.Template>
  1013. <ControlTemplate>
  1014. <StackPanel Background="Transparent" IsItemsHost="True" />
  1015. </ControlTemplate>
  1016. </ListBox.Template>
  1017. <ListBox.ItemTemplate>
  1018. <DataTemplate>
  1019. <Grid Height="28" Margin="5">
  1020. <Grid.ColumnDefinitions>
  1021. <ColumnDefinition Width="*" />
  1022. <ColumnDefinition Width="60" />
  1023. </Grid.ColumnDefinitions>
  1024. <TextBlock
  1025. x:Name="tb_Name"
  1026. HorizontalAlignment="Left"
  1027. VerticalAlignment="Center"
  1028. FontSize="15"
  1029. Foreground="White"
  1030. Text="{Binding RawMaterialName}" />
  1031. <Button
  1032. x:Name="BtnDelete"
  1033. Grid.Column="1"
  1034. HorizontalAlignment="Left"
  1035. VerticalAlignment="Center"
  1036. Background="Transparent"
  1037. Command="{Binding DataContext.AddDeviceMaterialCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
  1038. CommandParameter="{Binding Path=Text, ElementName=tb_Name}"
  1039. ToolTip="移除">
  1040. <Button.Template>
  1041. <ControlTemplate TargetType="Button">
  1042. <Grid>
  1043. <Rectangle
  1044. x:Name="BtnRetangle"
  1045. Width="17"
  1046. Height="17"
  1047. HorizontalAlignment="Left"
  1048. VerticalAlignment="Center"
  1049. Stroke="Transparent"
  1050. StrokeThickness="1">
  1051. <Rectangle.Fill>
  1052. <ImageBrush ImageSource="../../Image/按钮/AddGreen.png" />
  1053. </Rectangle.Fill>
  1054. </Rectangle>
  1055. <ContentPresenter
  1056. HorizontalAlignment="Center"
  1057. VerticalAlignment="Center"
  1058. Content="{TemplateBinding Content}" />
  1059. </Grid>
  1060. <ControlTemplate.Triggers>
  1061. <Trigger Property="IsMouseOver" Value="True">
  1062. <Setter TargetName="BtnRetangle" Property="Height" Value="19" />
  1063. <Setter TargetName="BtnRetangle" Property="Width" Value="19" />
  1064. </Trigger>
  1065. </ControlTemplate.Triggers>
  1066. </ControlTemplate>
  1067. </Button.Template>
  1068. </Button>
  1069. </Grid>
  1070. </DataTemplate>
  1071. </ListBox.ItemTemplate>
  1072. </ListBox>
  1073. </ScrollViewer>
  1074. <ScrollViewer
  1075. Grid.Column="2"
  1076. Margin="10,0,10,0"
  1077. CanContentScroll="True"
  1078. Template="{StaticResource ScrollViewerControlTemplate1}">
  1079. <ListBox
  1080. Width="230"
  1081. Background="Transparent"
  1082. FocusVisualStyle="{x:Null}"
  1083. ItemContainerStyle="{StaticResource ItemContainer}"
  1084. ItemsSource="{Binding UserDeviceMaterails}">
  1085. <ListBox.Template>
  1086. <ControlTemplate>
  1087. <StackPanel Background="Transparent" IsItemsHost="True" />
  1088. </ControlTemplate>
  1089. </ListBox.Template>
  1090. <ListBox.ItemTemplate>
  1091. <DataTemplate>
  1092. <Grid Height="28" Margin="5">
  1093. <Grid.ColumnDefinitions>
  1094. <ColumnDefinition Width="*" />
  1095. <ColumnDefinition Width="60" />
  1096. </Grid.ColumnDefinitions>
  1097. <TextBlock
  1098. x:Name="tb_Name"
  1099. HorizontalAlignment="Left"
  1100. VerticalAlignment="Center"
  1101. FontSize="15"
  1102. Foreground="White"
  1103. Text="{Binding RawMaterialName}" />
  1104. <Button
  1105. x:Name="BtnDelete"
  1106. Grid.Column="1"
  1107. HorizontalAlignment="Left"
  1108. VerticalAlignment="Center"
  1109. Background="Transparent"
  1110. Command="{Binding DataContext.DeleteDeviceMaterialCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
  1111. CommandParameter="{Binding Path=Text, ElementName=tb_Name}"
  1112. ToolTip="移除">
  1113. <Button.Template>
  1114. <ControlTemplate TargetType="Button">
  1115. <Grid>
  1116. <Rectangle
  1117. x:Name="BtnRetangle"
  1118. Width="17"
  1119. Height="17"
  1120. HorizontalAlignment="Left"
  1121. VerticalAlignment="Center"
  1122. Stroke="Transparent"
  1123. StrokeThickness="1">
  1124. <Rectangle.Fill>
  1125. <ImageBrush ImageSource="../../Image/按钮/Delete.png" />
  1126. </Rectangle.Fill>
  1127. </Rectangle>
  1128. <ContentPresenter
  1129. HorizontalAlignment="Center"
  1130. VerticalAlignment="Center"
  1131. Content="{TemplateBinding Content}" />
  1132. </Grid>
  1133. <ControlTemplate.Triggers>
  1134. <Trigger Property="IsMouseOver" Value="True">
  1135. <Setter TargetName="BtnRetangle" Property="Height" Value="19" />
  1136. <Setter TargetName="BtnRetangle" Property="Width" Value="19" />
  1137. </Trigger>
  1138. </ControlTemplate.Triggers>
  1139. </ControlTemplate>
  1140. </Button.Template>
  1141. </Button>
  1142. </Grid>
  1143. </DataTemplate>
  1144. </ListBox.ItemTemplate>
  1145. </ListBox>
  1146. </ScrollViewer>
  1147. <StackPanel
  1148. Grid.Column="1"
  1149. HorizontalAlignment="Center"
  1150. VerticalAlignment="Center">
  1151. <Button
  1152. Width="70"
  1153. Height="50"
  1154. Margin="10,20"
  1155. Background="#009DFF"
  1156. Command="{Binding AddAllCommand}"
  1157. CommandParameter="device"
  1158. FontSize="16"
  1159. Foreground="White">
  1160. <TextBlock Text="全部 添加" TextWrapping="Wrap" />
  1161. </Button>
  1162. <Button
  1163. Width="70"
  1164. Height="50"
  1165. Margin="10,20"
  1166. Background="#009DFF"
  1167. Command="{Binding DeleteAllCommand}"
  1168. CommandParameter="device"
  1169. FontSize="16"
  1170. Foreground="White">
  1171. <TextBlock Text="全部 移除" TextWrapping="Wrap" />
  1172. </Button>
  1173. </StackPanel>
  1174. </Grid>
  1175. </Border>
  1176. <!--#endregion-->
  1177. </Grid>
  1178. <Border
  1179. Grid.Row="3"
  1180. Margin="0,5,0,0"
  1181. BorderBrush="#064d87"
  1182. BorderThickness="0,1,0,0">
  1183. <StackPanel
  1184. Margin="0,0,50,0"
  1185. HorizontalAlignment="Right"
  1186. Orientation="Horizontal">
  1187. <Button
  1188. Width="120"
  1189. Height="40"
  1190. Margin="0,0,50,0"
  1191. HorizontalAlignment="Right"
  1192. Background="#064d87"
  1193. BorderThickness="0"
  1194. Command="{Binding SaveCommand}"
  1195. Content="保存"
  1196. FontSize="20"
  1197. Foreground="White"
  1198. Style="{StaticResource btn}"
  1199. TabIndex="3" />
  1200. <Button
  1201. Grid.Column="1"
  1202. Width="120"
  1203. Height="40"
  1204. HorizontalAlignment="Left"
  1205. Background="#064d87"
  1206. BorderThickness="0"
  1207. Command="{Binding CancelCommand}"
  1208. Content="取消"
  1209. FontSize="20"
  1210. Foreground="White"
  1211. Style="{StaticResource btn}"
  1212. TabIndex="3" />
  1213. </StackPanel>
  1214. </Border>
  1215. </Grid>
  1216. </Grid>
  1217. </Border>
  1218. </Window>