FormHeader.xaml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <UserControl x:Class="InABox.DynamicGrid.FormHeader"
  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:InABox.DynamicGrid"
  7. mc:Ignorable="d"
  8. x:Name="UserControl">
  9. <UserControl.Resources>
  10. <Style TargetType="Image">
  11. <Style.Triggers>
  12. <DataTrigger Binding="{Binding Path=Collapsed, ElementName=UserControl}" Value="False">
  13. <Setter Property="RenderTransform">
  14. <Setter.Value>
  15. <RotateTransform Angle="90"/>
  16. </Setter.Value>
  17. </Setter>
  18. </DataTrigger>
  19. </Style.Triggers>
  20. </Style>
  21. </UserControl.Resources>
  22. <Button Click="Button_Click" HorizontalContentAlignment="Left" Cursor="Hand"
  23. Background="{Binding Path=Background, ElementName=UserControl}" BorderBrush="Transparent">
  24. <StackPanel Orientation="Horizontal">
  25. <Image Width="32" Height="32"
  26. RenderTransformOrigin="0.5,0.5" Source="../../../Resources/header_closed.png"/>
  27. <TextBlock x:Name="TextBlock"
  28. Text="{Binding Path=HeaderText, ElementName=UserControl}"
  29. FontWeight="{Binding Path=FontWeight, ElementName=UserControl}"
  30. FontStyle="{Binding Path=FontStyle, ElementName=UserControl}"
  31. Foreground="{Binding Path=Foreground,ElementName=UserControl}"
  32. TextAlignment="Left"
  33. VerticalAlignment="Center"/>
  34. </StackPanel>
  35. </Button>
  36. </UserControl>