wEventAdd.xaml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <Page x:Class="teaTime.wEventAdd"
  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:teaTime"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800"
  9. Title="wEventAdd" Background="#D3DB94">
  10. <Page.Resources>
  11. <Style x:Key="FocusVisual">
  12. <Setter Property="Control.Template">
  13. <Setter.Value>
  14. <ControlTemplate>
  15. <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
  16. </ControlTemplate>
  17. </Setter.Value>
  18. </Setter>
  19. </Style>
  20. <SolidColorBrush x:Key="Button.Static.Background" Color="#E8ECC8"/>
  21. <SolidColorBrush x:Key="Button.Static.Border" Color="#E8ECC8"/>
  22. <SolidColorBrush x:Key="Button.MouseOver.Background" Color="#E8ECC8"/>
  23. <SolidColorBrush x:Key="Button.MouseOver.Border" Color="#E8ECC8"/>
  24. <SolidColorBrush x:Key="Button.Pressed.Background" Color="#E8ECC8"/>
  25. <SolidColorBrush x:Key="Button.Pressed.Border" Color="#E8ECC8"/>
  26. <SolidColorBrush x:Key="Button.Disabled.Background" Color="#E8ECC8"/>
  27. <SolidColorBrush x:Key="Button.Disabled.Border" Color="#E8ECC8"/>
  28. <SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#E8ECC8"/>
  29. <Style x:Key="RoundedButtonStyle" TargetType="{x:Type Button}">
  30. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
  31. <Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
  32. <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
  33. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
  34. <Setter Property="BorderThickness" Value="0"/>
  35. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  36. <Setter Property="VerticalContentAlignment" Value="Center"/>
  37. <Setter Property="Padding" Value="1"/>
  38. <Setter Property="Template">
  39. <Setter.Value>
  40. <ControlTemplate TargetType="{x:Type Button}">
  41. <Border x:Name="border" CornerRadius="10" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
  42. <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  43. </Border>
  44. <ControlTemplate.Triggers>
  45. <Trigger Property="IsDefaulted" Value="true">
  46. <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
  47. </Trigger>
  48. <Trigger Property="IsMouseOver" Value="true">
  49. <Setter Property="Background" TargetName="border" Value="#E8ECC8"/>
  50. <Setter Property="BorderBrush" TargetName="border" Value="#E8ECC8"/>
  51. </Trigger>
  52. <Trigger Property="IsPressed" Value="true">
  53. <Setter Property="Background" TargetName="border" Value="#E8ECC8"/>
  54. <Setter Property="BorderBrush" TargetName="border" Value="#E8ECC8"/>
  55. </Trigger>
  56. <Trigger Property="IsEnabled" Value="false">
  57. <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
  58. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
  59. <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
  60. </Trigger>
  61. </ControlTemplate.Triggers>
  62. </ControlTemplate>
  63. </Setter.Value>
  64. </Setter>
  65. </Style>
  66. <Style x:Key="RoundedButtonStyle2" TargetType="{x:Type Button}">
  67. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
  68. <Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
  69. <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
  70. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
  71. <Setter Property="BorderThickness" Value="0"/>
  72. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  73. <Setter Property="VerticalContentAlignment" Value="Center"/>
  74. <Setter Property="Padding" Value="1"/>
  75. <Setter Property="Template">
  76. <Setter.Value>
  77. <ControlTemplate TargetType="{x:Type Button}">
  78. <Border x:Name="border" CornerRadius="90" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
  79. <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  80. </Border>
  81. <ControlTemplate.Triggers>
  82. <Trigger Property="IsDefaulted" Value="true">
  83. <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
  84. </Trigger>
  85. <Trigger Property="IsMouseOver" Value="true">
  86. <Setter Property="Background" TargetName="border" Value="#E8ECC8"/>
  87. <Setter Property="BorderBrush" TargetName="border" Value="#E8ECC8"/>
  88. </Trigger>
  89. <Trigger Property="IsPressed" Value="true">
  90. <Setter Property="Background" TargetName="border" Value="#E8ECC8"/>
  91. <Setter Property="BorderBrush" TargetName="border" Value="#E8ECC8"/>
  92. </Trigger>
  93. <Trigger Property="IsEnabled" Value="false">
  94. <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
  95. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
  96. <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
  97. </Trigger>
  98. </ControlTemplate.Triggers>
  99. </ControlTemplate>
  100. </Setter.Value>
  101. </Setter>
  102. </Style>
  103. <Style x:Key="SimpleListBoxItem" TargetType="ListBoxItem">
  104. <Setter Property="Template">
  105. <Setter.Value>
  106. <ControlTemplate TargetType="ListBoxItem">
  107. <Border Name="Border" Padding="2" SnapsToDevicePixels="true">
  108. <ContentPresenter/>
  109. </Border>
  110. <ControlTemplate.Triggers>
  111. <Trigger Property="IsMouseOver" Value="true">
  112. <Setter TargetName="Border" Property="Background" Value="white"/>
  113. <Setter TargetName="Border" Property="BorderBrush" Value="#D3DB94"/>
  114. <Setter TargetName="Border" Property="BorderThickness" Value="2"/>
  115. </Trigger>
  116. <Trigger Property="IsSelected" Value="True">
  117. <Setter TargetName="Border" Property="Background" Value="{StaticResource Button.Static.Border}"/>
  118. <Setter TargetName="Border" Property="BorderBrush" Value="#D3DB94"/>
  119. </Trigger>
  120. </ControlTemplate.Triggers>
  121. </ControlTemplate>
  122. </Setter.Value>
  123. </Setter>
  124. </Style>
  125. </Page.Resources>
  126. <Viewbox Stretch="Uniform" Grid.RowSpan="2">
  127. <Border Width="800" Height="450">
  128. <Grid>
  129. <TextBlock Text="Добавить мероприятие" FontFamily="{StaticResource GogoiaDeco}" FontSize="35" HorizontalAlignment="Left" Foreground="#A77748" Margin="45 15 0 0"/>
  130. <Rectangle Fill="#FAEDCD" RadiusX="20" RadiusY="20" Height="350" Width="700" Margin="0,73,0,27"/>
  131. <Button x:Name="bClose" Width="35" Height="35" Margin="0 15 50 0" Click="bClose_Click" HorizontalAlignment="Right" VerticalAlignment="Top" Background="#FAEDCD" BorderThickness="0" Style="{DynamicResource RoundedButtonStyle2}">
  132. <Button.Content>
  133. <Grid>
  134. <Line X1="3" Y1="3" X2="20" Y2="20" Stroke="#D3DB94" StrokeDashArray="0.01" StrokeDashCap="Round" StrokeThickness="5"/>
  135. <Line X1="3" Y1="20" X2="20" Y2="3" Stroke="#D3DB94" StrokeDashArray="0.01" StrokeDashCap="Round" StrokeThickness="5" />
  136. </Grid>
  137. </Button.Content>
  138. </Button>
  139. <Button x:Name="bwrite" Width="140" Height="45" Margin="0,10,120,0" HorizontalAlignment="Right" VerticalAlignment="Top" VerticalContentAlignment="Center" Click="bwrite_Click" FontSize="25" FontFamily="{StaticResource GogoiaDeco}" Content="Создать" Foreground="#A77748" Background="#FAEDCD" Style="{DynamicResource RoundedButtonStyle}"/>
  140. <Grid Height="350" Width="750" Margin="0,73,0,27">
  141. <Grid>
  142. <TextBlock Text="Дата" FontFamily="{StaticResource GogoiaDeco}" FontWeight="Bold" FontSize="20" Foreground="#A77748" HorizontalAlignment="Left" Margin="55,25,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.561,0.943" />
  143. <TextBlock Text="Время" FontFamily="{StaticResource GogoiaDeco}" FontWeight="Bold" FontSize="20" Foreground="#A77748" HorizontalAlignment="Left" Margin="220,25,0,0" VerticalAlignment="Top" />
  144. <DatePicker x:Name="dp" Width="120" Height="45" FontSize="13" SelectedDateFormat="Short" Margin="90,23,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Background="#FAEDCD" Foreground="#A77748" FontFamily="{StaticResource UniNeue-Regular}" BorderThickness="0" SelectedDateChanged="DatePicker_SelectedDateChanged" Initialized="DatePicker_Initialized"/>
  145. <Grid Width="125" Height="20" Margin="265 25 0 0" HorizontalAlignment="Left" VerticalAlignment="Top">
  146. <StackPanel Orientation="Horizontal">
  147. <TextBox x:Name="aTime" FontSize="13" IsReadOnly ="False" Text="Выбор времени" Width="95" BorderThickness="0" Foreground="#A77748" FontFamily="{StaticResource UniNeue-Regular}" HorizontalContentAlignment="Stretch" />
  148. <ComboBox x:Name="nHour" Width="15" HorizontalAlignment="Left" Background="White" FontFamily="{StaticResource UniNeue-Regular}" IsEditable="True" BorderThickness="0" ToolTip="часы" SelectionChanged="nHour_SelectionChanged" Initialized="nHour_Initialized">
  149. </ComboBox>
  150. <ComboBox x:Name="nMin" Width="15" HorizontalAlignment="Left" Background="White" FontFamily="{StaticResource UniNeue-Regular}" IsEditable="True" BorderThickness="0" ToolTip="Минуты" SelectionChanged="nMin_SelectionChanged" Initialized="nMin_Initialized">
  151. </ComboBox>
  152. </StackPanel>
  153. </Grid>
  154. <TextBlock Text="Название" FontFamily="{StaticResource GogoiaDeco}" FontWeight="Bold" FontSize="20" Foreground="#A77748" HorizontalAlignment="Left" Margin="55,59,0,0" VerticalAlignment="Top" />
  155. <TextBox x:Name="aName" Text="" FontSize="10" HorizontalAlignment="Left" Margin="128,59,0,248" Foreground="#A77748" Width="262" TextWrapping="Wrap" Background="White" FontFamily="{StaticResource UniNeue-Regular}" BorderThickness="0"/>
  156. <TextBlock Text="Тема" FontFamily="{StaticResource GogoiaDeco}" FontWeight="Bold" FontSize="20" Foreground="#A77748" HorizontalAlignment="Left" Margin="55,111,0,0" VerticalAlignment="Top" />
  157. <TextBox x:Name="aTheme" Text="" FontSize="10" HorizontalAlignment="Left" Margin="128,111,0,196" Foreground="#A77748" Width="262" TextWrapping="Wrap" Background="White" FontFamily="{StaticResource UniNeue-Regular}" BorderThickness="0"/>
  158. <TextBlock Text="Описание:" FontFamily="{StaticResource GogoiaDeco}" FontWeight="Bold" FontSize="20" HorizontalAlignment="Left" Margin="55,165,0,-65" Foreground="#A77748"/>
  159. <TextBox x:Name="aDescript" Text="" FontSize="10" HorizontalAlignment="Left" Margin="128,165,0,21" Foreground="#A77748" Width="262" TextWrapping="Wrap" Background="White" FontFamily="{StaticResource UniNeue-Regular}" BorderThickness="0"/>
  160. </Grid>
  161. <TextBlock Text="чайная Программа:" FontFamily="{StaticResource GogoiaDeco}" FontWeight="Bold" FontSize="20" HorizontalAlignment="Left" Margin="423,25,0,85" Foreground="#A77748"/>
  162. <Grid Width="270" Height="270" Margin="370 35 0 0">
  163. <ListBox x:Name="nameTea" BorderThickness="0" SelectionChanged="nameTea_SelectionChanged" ItemContainerStyle="{DynamicResource SimpleListBoxItem}">
  164. <ListBox.ItemTemplate>
  165. <DataTemplate>
  166. <StackPanel Orientation="Horizontal">
  167. <TextBlock Text="{Binding num , Mode=TwoWay}" FontFamily="{StaticResource UniNeue-Regular}" Foreground="#A77748" FontSize="10" Width="50"/>
  168. <ComboBox ItemsSource="{Binding value}" Width="200" Background="White" Foreground="#A77748" HorizontalContentAlignment="Stretch" FontSize="10" SelectedValue="{Binding endTea}" FontFamily="{StaticResource UniNeue-Regular}" IsEditable="True" ToolTip="Чай"/>
  169. </StackPanel>
  170. </DataTemplate>
  171. </ListBox.ItemTemplate>
  172. </ListBox>
  173. </Grid>
  174. </Grid>
  175. </Grid>
  176. </Border>
  177. </Viewbox>
  178. </Page>