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

UserList.xaml 11 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年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <UserControl x:Class="BPASmart.UserManagement.View.UserList"
  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="200" >
  10. <UserControl.DataContext>
  11. <vm:UserListViewModel/>
  12. </UserControl.DataContext>
  13. <UserControl.Resources>
  14. <SolidColorBrush x:Key="menufont" Color="#B7C5DA"/>
  15. <Style x:Key="menuText" TargetType="TextBlock">
  16. <Setter Property="FontFamily" Value="pack://application:,,,/Fonts/#iconfont"/>
  17. <Setter Property="Foreground" Value="{DynamicResource menufont}"/>
  18. <Setter Property="FontSize" Value="16"/>
  19. <Setter Property="Margin" Value="2,0"/>
  20. <Setter Property="VerticalAlignment" Value="Center"/>
  21. <Setter Property="HorizontalAlignment" Value="Center"/>
  22. </Style>
  23. <Style x:Key="ItemContainer" TargetType="ListBoxItem">
  24. <Setter Property="Background" Value="Transparent"/>
  25. <Setter Property="Margin" Value="5"/>
  26. <Setter Property="Template">
  27. <Setter.Value>
  28. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  29. <Border x:Name="IconBorder" CornerRadius="4" BorderThickness="0,1,0,1" Background="Transparent" Opacity="0.8">
  30. <Grid Margin="20,10,0,10" HorizontalAlignment="Left" >
  31. <Grid.ColumnDefinitions>
  32. <ColumnDefinition Width="auto"/>
  33. <ColumnDefinition Width="auto"/>
  34. </Grid.ColumnDefinitions>
  35. <TextBlock x:Name="userIcon" Text="&#xe671;" FontFamily="pack://application:,,,/Fonts/#iconfont"
  36. Foreground="{DynamicResource commanTextblock}" FontSize="26"
  37. HorizontalAlignment="Center" VerticalAlignment="Center"/>
  38. <TextBlock x:Name="userText" Grid.Column="1" Text="{Binding UserName}" Foreground="{DynamicResource commanTextblock}"
  39. FontSize="18" FontFamily="楷体"
  40. HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20,5,0,0"/>
  41. </Grid>
  42. </Border>
  43. <ControlTemplate.Triggers>
  44. <Trigger Property="IsMouseOver" Value="true">
  45. <Setter TargetName="IconBorder" Property="BorderBrush" Value="#ff8EE5EE"/>
  46. <Setter TargetName="IconBorder" Property="Background">
  47. <Setter.Value>
  48. <ImageBrush ImageSource="../Image/用户名边框.png"/>
  49. </Setter.Value>
  50. </Setter>
  51. <Setter TargetName="userText" Property="Foreground" Value="Orange"/>
  52. <Setter TargetName="userIcon" Property="Foreground" Value="Orange"/>
  53. <!--<Setter TargetName="userImage" Property="Source" Value="../image/账户黄.png"/>-->
  54. </Trigger>
  55. <Trigger Property="IsFocused" Value="true">
  56. <!--<Setter TargetName="IconBorder" Property="BorderBrush" Value="#ff8EE5EE"/>-->
  57. <Setter TargetName="IconBorder" Property="Background">
  58. <Setter.Value>
  59. <ImageBrush ImageSource="../Image/方形.png"/>
  60. </Setter.Value>
  61. </Setter>
  62. <Setter TargetName="userText" Property="Foreground" Value="Orange"/>
  63. <Setter TargetName="userIcon" Property="Foreground" Value="Orange"/>
  64. <!--<Setter TargetName="userImage" Property="Source" Value="../image/账户黄.png"/>-->
  65. </Trigger>
  66. </ControlTemplate.Triggers>
  67. </ControlTemplate>
  68. </Setter.Value>
  69. </Setter>
  70. </Style>
  71. <Style x:Key="listbox" TargetType="ListBox">
  72. <Setter Property="Background" Value="Transparent"/>
  73. <Setter Property="BorderBrush" Value="Transparent"/>
  74. <Setter Property="BorderThickness" Value="0"/>
  75. </Style>
  76. </UserControl.Resources>
  77. <Border>
  78. <Border.Background>
  79. <!--<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
  80. <GradientStop Color="#FF00203B" Offset="0"/>
  81. <GradientStop Color="#FF020026" Offset="1"/>
  82. </LinearGradientBrush>-->
  83. <ImageBrush ImageSource="../Image/用户边框1.png"/>
  84. </Border.Background>
  85. <Grid>
  86. <Grid.RowDefinitions>
  87. <RowDefinition Height="*"/>
  88. <RowDefinition Height="12*"/>
  89. </Grid.RowDefinitions>
  90. <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" >
  91. <Image Source="../image/List.png" Height="19" Margin="2,2,4,0" VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
  92. <TextBlock Text="用户列表" Foreground="White" FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" />
  93. </StackPanel>
  94. <Border Grid.Row="1" BorderBrush="Transparent" BorderThickness="0,1,0,0">
  95. <ScrollViewer Background="Transparent"
  96. Grid.Row="1" Margin="5" Template="{DynamicResource ScrollViewerControlTemplate1 }" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
  97. <ListBox Style="{DynamicResource listbox}" ItemContainerStyle="{DynamicResource ItemContainer}" ItemsSource="{Binding userManagers}" >
  98. <ListBox.ContextMenu>
  99. <ContextMenu Height="auto">
  100. <MenuItem Command="{Binding RegisterNewUserCommand}" >
  101. <MenuItem.Header>
  102. <Grid>
  103. <Grid.ColumnDefinitions>
  104. <ColumnDefinition Width="auto"/>
  105. <ColumnDefinition Width="*"/>
  106. </Grid.ColumnDefinitions>
  107. <TextBlock Style="{DynamicResource menuText}" Text="&#xe6d6;"/>
  108. <TextBlock Grid.Column="1" Text="注册新用户" Style="{DynamicResource menuText}" FontFamily="楷体"/>
  109. </Grid>
  110. </MenuItem.Header>
  111. </MenuItem>
  112. <MenuItem Command="{Binding ChangePasswordCommand}"
  113. CommandParameter="{Binding PlacementTarget.SelectedItem,RelativeSource={RelativeSource AncestorType=ContextMenu,Mode=FindAncestor}}">
  114. <MenuItem.Header>
  115. <Grid>
  116. <Grid.ColumnDefinitions>
  117. <ColumnDefinition Width="auto"/>
  118. <ColumnDefinition Width="*"/>
  119. </Grid.ColumnDefinitions>
  120. <TextBlock Style="{DynamicResource menuText}" Text="&#xe611;"/>
  121. <TextBlock Grid.Column="1" Text="修改密码" Style="{DynamicResource menuText}" FontFamily="楷体" />
  122. </Grid>
  123. </MenuItem.Header>
  124. </MenuItem>
  125. <MenuItem Command="{Binding EditUsetPowerCommand}"
  126. CommandParameter="{Binding PlacementTarget.SelectedItem,RelativeSource={RelativeSource AncestorType=ContextMenu,Mode=FindAncestor}}">
  127. <MenuItem.Header>
  128. <Grid>
  129. <Grid.ColumnDefinitions>
  130. <ColumnDefinition Width="auto"/>
  131. <ColumnDefinition Width="*"/>
  132. </Grid.ColumnDefinitions>
  133. <TextBlock Style="{DynamicResource menuText}" Text="&#xf0213;"/>
  134. <TextBlock Grid.Column="1" Text="编辑权限" Style="{DynamicResource menuText}" FontFamily="楷体"/>
  135. </Grid>
  136. </MenuItem.Header>
  137. </MenuItem>
  138. <MenuItem Command="{Binding DeleteUserCommand}"
  139. CommandParameter="{Binding PlacementTarget.SelectedItem,RelativeSource={RelativeSource AncestorType=ContextMenu,Mode=FindAncestor}}">
  140. <MenuItem.Header>
  141. <Grid>
  142. <Grid.ColumnDefinitions>
  143. <ColumnDefinition Width="auto"/>
  144. <ColumnDefinition Width="*"/>
  145. </Grid.ColumnDefinitions>
  146. <TextBlock Style="{DynamicResource menuText}" Text="&#xe8c1;"/>
  147. <TextBlock Grid.Column="1" Text="删除用户" Style="{DynamicResource menuText}" FontFamily="楷体"/>
  148. </Grid>
  149. </MenuItem.Header>
  150. </MenuItem>
  151. </ContextMenu>
  152. </ListBox.ContextMenu>
  153. </ListBox>
  154. </ScrollViewer>
  155. </Border>
  156. </Grid>
  157. </Border>
  158. </UserControl>