UsersData.xaml 6.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <Page x:Class="MusicSmth.UsersData"
  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:MusicSmth"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800"
  9. Title="UsersData">
  10. <Page.Resources>
  11. <SolidColorBrush x:Key="Button.MouseOver.Background" Color="#FFBEE6FD"/>
  12. <SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF3C7FB1"/>
  13. <SolidColorBrush x:Key="Button.Pressed.Background" Color="#FFC4E5F6"/>
  14. <SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/>
  15. <SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
  16. <SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/>
  17. <SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383"/>
  18. <ControlTemplate x:Key="ButtonTemplate1" TargetType="{x:Type ButtonBase}">
  19. <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
  20. <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  21. </Border>
  22. <ControlTemplate.Triggers>
  23. <Trigger Property="Button.IsDefaulted" Value="true">
  24. <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
  25. </Trigger>
  26. <Trigger Property="IsEnabled" Value="false">
  27. <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
  28. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
  29. <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
  30. </Trigger>
  31. </ControlTemplate.Triggers>
  32. </ControlTemplate>
  33. <SolidColorBrush x:Key="TextBox.MouseOver.Border" Color="#FF7EB4EA"/>
  34. <SolidColorBrush x:Key="TextBox.Focus.Border" Color="#FF569DE5"/>
  35. <ControlTemplate x:Key="TextBoxTemplate1" TargetType="{x:Type TextBoxBase}">
  36. <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
  37. <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
  38. </Border>
  39. </ControlTemplate>
  40. </Page.Resources>
  41. <Grid Background="#1DB954">
  42. <Grid.RowDefinitions>
  43. <RowDefinition Height="*"></RowDefinition>
  44. <RowDefinition Height="*"></RowDefinition>
  45. </Grid.RowDefinitions>
  46. <DataGrid BorderThickness="0" ColumnHeaderStyle="{DynamicResource HeadDefault}" Grid.Row="0" Background="#1DB954" x:Name="Data" CanUserAddRows="False" AutoGenerateColumns="False" HorizontalAlignment="Center" RowBackground="Black" Foreground="White">
  47. <DataGrid.Columns>
  48. <DataGridTextColumn Header="Имя" Width="*" Binding="{Binding Path=Name}"/>
  49. <DataGridTextColumn Header="Фамилия" Width="*" Binding="{Binding Path=Surname}"/>
  50. <DataGridTextColumn Header="Отчество" Width="*" Binding="{Binding Path=Patronymic}"/>
  51. <DataGridTextColumn Header="Пол" Width="*" Binding="{Binding Path=Genders.Gender}"/>
  52. <DataGridTextColumn Header="Логин" Width="*" Binding="{Binding Path=Login}"/>
  53. <DataGridTextColumn Header="Дата рождения" Width="*" Binding="{Binding Path=BirthDate , StringFormat=\{0:dd.MM.yyyy\}}"/>
  54. </DataGrid.Columns>
  55. </DataGrid>
  56. <StackPanel Grid.Row="1">
  57. <Border Style="{DynamicResource BorderDefault}" Width="180" Margin="0,50,0,0">
  58. <Button Template="{DynamicResource ButtonTemplate1}" Style="{DynamicResource ButtonDefault}" Click="SortAZ">Сортировка А-Я по фамилии</Button>
  59. </Border>
  60. <Border Style="{DynamicResource BorderDefault}" Width="180" Margin="0,10,0,0">
  61. <Button Template="{DynamicResource ButtonTemplate1}" Style="{DynamicResource ButtonDefault}" Click="SortZA">Сортировка Я-А по фамилии</Button>
  62. </Border>
  63. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  64. <Border Style="{DynamicResource BorderDefault}" Width="90" Margin="0,10,5,0">
  65. <Button Template="{DynamicResource ButtonTemplate1}" Style="{DynamicResource ButtonDefault}" Click="FindM">Найти М</Button>
  66. </Border>
  67. <Border Style="{DynamicResource BorderDefault}" Width="90" Margin="0,10,0,0">
  68. <Button Template="{DynamicResource ButtonTemplate1}" Style="{DynamicResource ButtonDefault}" Click="FindW">Найти Ж</Button>
  69. </Border>
  70. </StackPanel>
  71. <TextBlock Margin="0,10,0,0" HorizontalAlignment="Center">Введите поиск (по фамилии или имени)</TextBlock>
  72. <Border Style="{DynamicResource BorderInput}" Height="20" Width="180" Margin="0,5,0,0">
  73. <TextBox Template="{DynamicResource TextBoxTemplate1}" Style="{DynamicResource InputDefault}" Name="SearchString"/>
  74. </Border>
  75. <Border Style="{DynamicResource BorderDefault}" Width="90" Margin="0,10,0,0" Height="20">
  76. <Button Template="{DynamicResource ButtonTemplate1}" Style="{DynamicResource ButtonDefault}" Click="Search">Искать</Button>
  77. </Border>
  78. </StackPanel>
  79. <StackPanel Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="10,0,0,10">
  80. <Border Style="{DynamicResource BorderDefault}" Width="90" Height="20">
  81. <Button Template="{DynamicResource ButtonTemplate1}" Style="{DynamicResource ButtonDefault}" Click="Back">Назад</Button>
  82. </Border>
  83. </StackPanel>
  84. </Grid>
  85. </Page>