AgentPage.xaml 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <Page x:Class="ExamTry.Pages.AgentPage"
  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:ExamTry.Pages"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800"
  9. Title="AgentPage">
  10. <Page.Resources>
  11. <Style x:Key="styleSale" TargetType="StackPanel">
  12. <Style.Triggers>
  13. <DataTrigger Binding="{Binding greenSale}" Value="true">
  14. <Setter Property="Background" Value="#FF5CF95C"/>
  15. </DataTrigger>
  16. </Style.Triggers>
  17. </Style>
  18. <DataTemplate x:Key="AgentData">
  19. <StackPanel Style="{StaticResource styleSale}" HorizontalAlignment="Center" Orientation="Horizontal">
  20. <StackPanel Margin="10">
  21. <Image Width="80" Height="80" Source="{Binding GetImage}"/>
  22. </StackPanel>
  23. <StackPanel Width="800" Orientation="Vertical">
  24. <StackPanel Orientation="Horizontal">
  25. <TextBlock Text="{Binding AgentType.Title}"/>
  26. <TextBlock Text=" | "/>
  27. <TextBlock Text="{ Binding Title}"/>
  28. </StackPanel>
  29. <StackPanel Orientation="Horizontal">
  30. <TextBlock Text="{Binding GetProductionYear}"/>
  31. <TextBlock Text=" продажи за год"/>
  32. </StackPanel>
  33. <TextBlock Text="{Binding Phone}"/>
  34. <StackPanel Orientation="Horizontal">
  35. <TextBlock Text="Приоритетность: "/>
  36. <TextBlock Text="{Binding Priority}"/>
  37. </StackPanel>
  38. </StackPanel>
  39. <StackPanel HorizontalAlignment="Right" VerticalAlignment="Top">
  40. <TextBlock Text="{Binding GetProductionSale}"/>
  41. </StackPanel>
  42. </StackPanel>
  43. </DataTemplate>
  44. </Page.Resources>
  45. <Grid>
  46. <Grid.RowDefinitions>
  47. <RowDefinition Height="50"/>
  48. <RowDefinition Height="206*"/>
  49. </Grid.RowDefinitions>
  50. <StackPanel Grid.Row="0" Orientation="Vertical" >
  51. <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
  52. <TextBox Text="{Binding SetTextForSort}" Margin="5" Width="100"/>
  53. <ComboBox SelectedIndex="{Binding GetIndexOrderBy}" Margin="5" Width="100">
  54. <ComboBoxItem >
  55. По возрастанию
  56. </ComboBoxItem>
  57. <ComboBoxItem>
  58. По убыванию
  59. </ComboBoxItem>
  60. </ComboBox>
  61. <ComboBox SelectedIndex="{Binding GetIndexSort}" Margin="5" Width="100">
  62. <ComboBoxItem>
  63. Наименованию
  64. </ComboBoxItem>
  65. <ComboBoxItem>
  66. Размер скидки
  67. </ComboBoxItem>
  68. <ComboBoxItem>
  69. Приоритет агента
  70. </ComboBoxItem>
  71. </ComboBox>
  72. <ComboBox SelectedIndex="{Binding GetTypeIndex}" ItemsSource="{Binding GetTypeAgent}" Margin="5" Width="100"/>
  73. <Button Content="Добавить агента"
  74. Name="AddAgent"
  75. Click="OpenWindowAddAgent"/>
  76. <Button
  77. Click="ChagePrior"
  78. x:Name="prioritetyBtn"
  79. Visibility="Collapsed"
  80. Content="Изменить приоритет на ...">
  81. </Button>
  82. </StackPanel>
  83. </StackPanel>
  84. <ListBox
  85. x:Name="AgentList"
  86. Grid.Row="1"
  87. ItemsSource="{Binding GetAgents}"
  88. ItemTemplate="{StaticResource AgentData}"
  89. HorizontalAlignment="Center"
  90. SelectionMode="Extended"
  91. SelectionChanged="AgentList_SelectionChanged"
  92. MouseDoubleClick="EditAgent"
  93. SelectedItem="{Binding GetAgent}"/>
  94. </Grid>
  95. </Page>