App.xaml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <Application x:Class="MyWpfApp.App"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:local="clr-namespace:MyWpfApp"
  5. StartupUri="MainWindow.xaml">
  6. <Application.Resources>
  7. <Style x:Key="Zagolovok" TargetType="TextBlock">
  8. <Setter Property="FontSize" Value="48"/>
  9. <Setter Property="FontFamily" Value="Comic Sans MS"/>
  10. <Setter Property="Background" Value="DimGray"/>
  11. <Setter Property="TextAlignment" Value="Center"/>
  12. </Style>
  13. <Style TargetType="Button">
  14. <Setter Property="Background" Value="Azure"/>
  15. </Style>
  16. <Style TargetType="TextBlock">
  17. <Setter Property="Background" Value="YellowGreen"/>
  18. </Style>
  19. <Style TargetType="GroupBox">
  20. <Setter Property="Background" Value="LightGreen"/>
  21. </Style>
  22. <Style TargetType="TextBox">
  23. <Setter Property="Background" Value="IndianRed"/>
  24. <Setter Property="TextDecorations" Value="Underline"/>
  25. <Setter Property="FontSize" Value="20"/>
  26. </Style>
  27. <Style TargetType="PasswordBox">
  28. <Setter Property="Background" Value="Bisque"/>
  29. </Style>
  30. <ControlTemplate TargetType="Button" x:Key="Template1">
  31. <Border BorderBrush="Aqua" BorderThickness="3" x:Name="border">
  32. <ContentControl Content="{TemplateBinding Content}"/>
  33. </Border>
  34. <ControlTemplate.Triggers>
  35. <Trigger Property="IsMouseOver" Value="true">
  36. <Setter TargetName="border" Property="BorderThickness" Value="10"/>
  37. </Trigger>
  38. </ControlTemplate.Triggers>
  39. </ControlTemplate>
  40. </Application.Resources>
  41. </Application>