AddEditWindow.xaml 2.0 KB

123456789101112131415161718192021222324252627282930313233
  1. <Window x:Class="VideoprokatApp.AddEditWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. Title="Добавить/Редактировать запись" Height="300" Width="400">
  5. <Window.Resources>
  6. <Style x:Key="WatermarkTextBox" TargetType="TextBox">
  7. <Setter Property="Foreground" Value="LightGray"/>
  8. <Setter Property="Text" Value="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"/>
  9. <Style.Triggers>
  10. <MultiTrigger>
  11. <MultiTrigger.Conditions>
  12. <Condition Property="Text" Value=""/>
  13. <Condition Property="IsFocused" Value="False"/>
  14. </MultiTrigger.Conditions>
  15. <Setter Property="Foreground" Value="LightGray"/>
  16. <Setter Property="Text" Value="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"/>
  17. </MultiTrigger>
  18. <Trigger Property="IsFocused" Value="True">
  19. <Setter Property="Foreground" Value="Black"/>
  20. </Trigger>
  21. </Style.Triggers>
  22. </Style>
  23. </Window.Resources>
  24. <Grid>
  25. <StackPanel Margin="10">
  26. <TextBox x:Name="NomerKassetyTextBox" Text="{Binding NomerKassety}" Tag="Введите номер кассеты" Style="{StaticResource WatermarkTextBox}" />
  27. <TextBox x:Name="KodFilmaTextBox" Text="{Binding KlassifikatsionnyKod.NazvanieFilma}" Tag="Введите код фильма" Style="{StaticResource WatermarkTextBox}" />
  28. <CheckBox x:Name="PriznakNalichiyaCheckBox" IsChecked="{Binding PriznakNalichiya}" Content="Признак наличия" />
  29. <Button Content="Сохранить" Click="SaveButton_Click" Margin="0,10,0,0"/>
  30. <Button Content="Отмена" Click="CancelButton_Click" Margin="0,10,0,0"/>
  31. </StackPanel>
  32. </Grid>
  33. </Window>