终端一体化运控平台
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

282 wiersze
19 KiB

  1. <UserControl x:Class="BPASmart.UserManagement.View.EditPower"
  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:BPASmart.UserManagement.View"
  7. xmlns:vm="clr-namespace:BPASmart.UserManagement.ViewModel"
  8. mc:Ignorable="d"
  9. d:DesignHeight="450" d:DesignWidth="800" FontFamily="楷体">
  10. <UserControl.DataContext>
  11. <vm:EditPowerViewModel/>
  12. </UserControl.DataContext>
  13. <UserControl.Resources>
  14. <Style x:Key="ItemContainer" TargetType="{x:Type ListBoxItem}">
  15. <Setter Property="Template">
  16. <Setter.Value>
  17. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  18. <Border x:Name="IconBorder" Background="Transparent" CornerRadius="4" BorderThickness="0">
  19. <ContentPresenter />
  20. </Border>
  21. <ControlTemplate.Triggers>
  22. <Trigger Property="IsSelected" Value="true">
  23. <Setter TargetName="IconBorder" Property="BitmapEffect">
  24. <Setter.Value>
  25. <OuterGlowBitmapEffect GlowColor="Transparent" GlowSize="5" />
  26. </Setter.Value>
  27. </Setter>
  28. </Trigger>
  29. </ControlTemplate.Triggers>
  30. </ControlTemplate>
  31. </Setter.Value>
  32. </Setter>
  33. </Style>
  34. </UserControl.Resources>
  35. <Border Margin="10,20">
  36. <Border.Background>
  37. <ImageBrush ImageSource="pack://application:,,,/BPASmart.CustomResource;component/Image/方形背景2.png"/>
  38. </Border.Background>
  39. <Grid>
  40. <Grid.RowDefinitions>
  41. <RowDefinition Height="18*"/>
  42. <RowDefinition Height="391*"/>
  43. </Grid.RowDefinitions>
  44. <TextBlock Text="权限编辑"
  45. FontSize="18" Foreground="#F0FFF0"
  46. HorizontalAlignment="Center" VerticalAlignment="Center" Width="72"/>
  47. <Grid Grid.Row="1">
  48. <Grid.RowDefinitions>
  49. <RowDefinition Height="3*"/>
  50. <RowDefinition Height="40*"/>
  51. <RowDefinition Height="328*"/>
  52. </Grid.RowDefinitions>
  53. <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,0,0,2"
  54. HorizontalAlignment="Center" VerticalAlignment="Center">
  55. <TextBlock Text="用户名:" Foreground="{DynamicResource commanTextblock}" FontSize="18"
  56. HorizontalAlignment="Center" VerticalAlignment="Center"/>
  57. <ComboBox Width="120" Margin="20,0" ItemsSource="{Binding UserNames}" SelectedItem="{Binding CurrentUserName}" FontSize="16" Foreground="{DynamicResource commanTextblock}"
  58. Style="{DynamicResource CommonCombox}"/>
  59. <Button Content="保存" Style="{DynamicResource CommonButton}" Width="100" FontSize="18" Command="{Binding SaveUserPowerCommand}" Margin="10,0"/>
  60. <Button Content="取消" Style="{DynamicResource CommonButton}" Width="100" FontSize="18" Command="{Binding CancelCommand}" Margin="10,0"/>
  61. </StackPanel>
  62. <Grid Grid.Row="2" Margin="5">
  63. <Grid.ColumnDefinitions>
  64. <ColumnDefinition Width="0.15*"/>
  65. <ColumnDefinition Width="*"/>
  66. <ColumnDefinition Width="0.35*"/>
  67. <ColumnDefinition Width="*"/>
  68. <ColumnDefinition Width="0.15*"/>
  69. </Grid.ColumnDefinitions>
  70. <Grid.RowDefinitions>
  71. <RowDefinition Height="14*"/>
  72. <RowDefinition Height="1*"/>
  73. </Grid.RowDefinitions>
  74. <!--#region 界面列表-->
  75. <Border Grid.Column="1" Margin="20,0,20,0">
  76. <Border.Background>
  77. <ImageBrush ImageSource="../Image/方形背景3.png"/>
  78. </Border.Background>
  79. <ScrollViewer CanContentScroll="True" Template="{DynamicResource ScrollViewerControlTemplate1}"
  80. Width="auto" Margin="10" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
  81. <ListBox Background="Transparent" ItemContainerStyle="{StaticResource ItemContainer}" FocusVisualStyle="{x:Null}"
  82. ItemsSource="{Binding pageList}" >
  83. <ListBox.Template>
  84. <ControlTemplate>
  85. <StackPanel Background="Transparent" IsItemsHost="True"></StackPanel>
  86. </ControlTemplate>
  87. </ListBox.Template>
  88. <ListBox.ItemTemplate>
  89. <DataTemplate>
  90. <Button Background="Transparent" BorderBrush="Transparent" BorderThickness="0" Style="{DynamicResource ButtontextStyle}"
  91. Command="{Binding DataContext.AddPageCommand, RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor}}"
  92. CommandParameter="{Binding Name}">
  93. <Border x:Name="leftborder" Width="130" HorizontalAlignment="Center" Margin="5">
  94. <Border.Background>
  95. <ImageBrush ImageSource="../Image/文字背景2.png"/>
  96. </Border.Background>
  97. <TextBlock Text="{Binding Name}" Margin="8"
  98. FontSize="18" Foreground="white" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  99. </Border>
  100. </Button>
  101. <DataTemplate.Triggers>
  102. <Trigger Property="IsMouseOver" Value="true">
  103. <Setter Property="Width" Value="160" TargetName="leftborder"/>
  104. </Trigger>
  105. </DataTemplate.Triggers>
  106. </DataTemplate>
  107. </ListBox.ItemTemplate>
  108. </ListBox>
  109. </ScrollViewer>
  110. </Border>
  111. <!--#endregion-->
  112. <Grid Grid.Column="2">
  113. <Grid.RowDefinitions>
  114. <RowDefinition />
  115. <RowDefinition />
  116. </Grid.RowDefinitions>
  117. <Button Width="80" Height="80" Command="{Binding AddAllPageCommand}">
  118. <Button.Template>
  119. <ControlTemplate TargetType="{x:Type Button}">
  120. <Border >
  121. <Grid>
  122. <StackPanel Orientation="Vertical" Margin="5" HorizontalAlignment="Center" VerticalAlignment="Center" >
  123. <TextBlock Text="全部" FontSize="20" Foreground="{DynamicResource commanTextblock}"/>
  124. <TextBlock Text="添加" FontSize="20" Foreground="{DynamicResource commanTextblock}"/>
  125. </StackPanel>
  126. <Border>
  127. <Border.Background>
  128. <ImageBrush x:Name="image" ImageSource="../Image/圆形按钮背景2.png">
  129. </ImageBrush>
  130. </Border.Background>
  131. <Border.Style>
  132. <Style TargetType="Border">
  133. <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
  134. <Setter Property="RenderTransform">
  135. <Setter.Value>
  136. <TransformGroup>
  137. <RotateTransform/>
  138. </TransformGroup>
  139. </Setter.Value>
  140. </Setter>
  141. <Style.Triggers>
  142. <EventTrigger RoutedEvent="Loaded" >
  143. <EventTrigger.Actions>
  144. <BeginStoryboard x:Name="run1">
  145. <Storyboard RepeatBehavior="Forever" Storyboard.TargetProperty="RenderTransform.Children[0].Angle">
  146. <DoubleAnimation From="0" To="360" Duration="0:0:6"/>
  147. </Storyboard>
  148. </BeginStoryboard>
  149. <PauseStoryboard BeginStoryboardName="run1"/>
  150. </EventTrigger.Actions>
  151. </EventTrigger>
  152. <Trigger Property="IsMouseOver" Value="True">
  153. <Trigger.EnterActions>
  154. <ResumeStoryboard BeginStoryboardName="run1"/>
  155. </Trigger.EnterActions>
  156. </Trigger>
  157. <Trigger Property="IsMouseOver" Value="False">
  158. <Trigger.EnterActions>
  159. <PauseStoryboard BeginStoryboardName="run1"/>
  160. </Trigger.EnterActions>
  161. </Trigger>
  162. </Style.Triggers>
  163. </Style>
  164. </Border.Style>
  165. </Border>
  166. </Grid>
  167. </Border>
  168. </ControlTemplate>
  169. </Button.Template>
  170. </Button>
  171. <Button Grid.Row="1" Width="80" Height="80" Command="{Binding DeleteAllPageCommand}">
  172. <Button.Template>
  173. <ControlTemplate TargetType="{x:Type Button}">
  174. <Border >
  175. <Grid>
  176. <StackPanel Orientation="Vertical" Margin="5" HorizontalAlignment="Center" VerticalAlignment="Center" >
  177. <TextBlock Text="全部" FontSize="20" Foreground="{DynamicResource commanTextblock}"/>
  178. <TextBlock Text="移除" FontSize="20" Foreground="{DynamicResource commanTextblock}"/>
  179. </StackPanel>
  180. <Border x:Name="myborder">
  181. <Border.Background>
  182. <ImageBrush x:Name="image" ImageSource="../Image/圆形按钮背景1.png">
  183. </ImageBrush>
  184. </Border.Background>
  185. <Border.Style>
  186. <Style TargetType="Border">
  187. <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
  188. <Setter Property="RenderTransform">
  189. <Setter.Value>
  190. <TransformGroup>
  191. <RotateTransform/>
  192. </TransformGroup>
  193. </Setter.Value>
  194. </Setter>
  195. <Style.Triggers>
  196. <EventTrigger RoutedEvent="Loaded" >
  197. <EventTrigger.Actions>
  198. <BeginStoryboard x:Name="run1">
  199. <Storyboard RepeatBehavior="Forever" Storyboard.TargetProperty="RenderTransform.Children[0].Angle">
  200. <DoubleAnimation From="360" To="0" Duration="0:0:6"/>
  201. </Storyboard>
  202. </BeginStoryboard>
  203. <PauseStoryboard BeginStoryboardName="run1"/>
  204. </EventTrigger.Actions>
  205. </EventTrigger>
  206. <Trigger Property="IsMouseOver" Value="True">
  207. <Trigger.EnterActions>
  208. <ResumeStoryboard BeginStoryboardName="run1"/>
  209. </Trigger.EnterActions>
  210. </Trigger>
  211. <Trigger Property="IsMouseOver" Value="False">
  212. <Trigger.EnterActions>
  213. <PauseStoryboard BeginStoryboardName="run1" />
  214. </Trigger.EnterActions>
  215. </Trigger>
  216. </Style.Triggers>
  217. </Style>
  218. </Border.Style>
  219. </Border>
  220. </Grid>
  221. </Border>
  222. </ControlTemplate>
  223. </Button.Template>
  224. </Button>
  225. </Grid>
  226. <!--#region 用户界面列表-->
  227. <Border Grid.Column="3" Margin="20,0,20,0">
  228. <Border.Background>
  229. <ImageBrush ImageSource="../Image/方形背景3.png"/>
  230. </Border.Background>
  231. <ScrollViewer CanContentScroll="True" Template="{DynamicResource ScrollViewerControlTemplate1}"
  232. Width="auto" Margin="10" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
  233. <ListBox Background="Transparent" ItemContainerStyle="{StaticResource ItemContainer}" FocusVisualStyle="{x:Null}" Width="auto"
  234. ItemsSource="{Binding userPageList}" >
  235. <ListBox.Template>
  236. <ControlTemplate>
  237. <StackPanel Background="Transparent" IsItemsHost="True"></StackPanel>
  238. </ControlTemplate>
  239. </ListBox.Template>
  240. <ListBox.ItemTemplate>
  241. <DataTemplate>
  242. <Button Background="Transparent" BorderBrush="Transparent" BorderThickness="0" Style="{DynamicResource ButtontextStyle}"
  243. Command="{Binding DataContext.DeletePageCommand, RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor}}"
  244. CommandParameter="{Binding Name}">
  245. <Border x:Name="leftborder" Width="130" HorizontalAlignment="Center" Margin="5">
  246. <Border.Background>
  247. <ImageBrush ImageSource="../Image/文字背景2.png"/>
  248. </Border.Background>
  249. <TextBlock Text="{Binding Name}" Margin="8"
  250. FontSize="18" Foreground="white" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  251. </Border>
  252. </Button>
  253. <DataTemplate.Triggers>
  254. <Trigger Property="IsMouseOver" Value="true">
  255. <Setter Property="Width" Value="160" TargetName="leftborder"/>
  256. </Trigger>
  257. </DataTemplate.Triggers>
  258. </DataTemplate>
  259. </ListBox.ItemTemplate>
  260. </ListBox>
  261. </ScrollViewer>
  262. </Border>
  263. <!--#endregion-->
  264. </Grid>
  265. </Grid>
  266. </Grid>
  267. </Border>
  268. </UserControl>