|
| 1 | +<UserControl x:Class="MeowType.NetDebug.Tab" |
| 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:MeowType.NetDebug" |
| 7 | + mc:Ignorable="d" Name="_this" |
| 8 | + d:DesignHeight="30" d:DesignWidth="200" MinWidth="50" MaxWidth="200"> |
| 9 | + <UserControl.Resources> |
| 10 | + <Style x:Key="FocusVisual"> |
| 11 | + <Setter Property="Control.Template"> |
| 12 | + <Setter.Value> |
| 13 | + <ControlTemplate> |
| 14 | + <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/> |
| 15 | + </ControlTemplate> |
| 16 | + </Setter.Value> |
| 17 | + </Setter> |
| 18 | + </Style> |
| 19 | + <SolidColorBrush x:Key="Button.Static.Background" Color="#00DDDDDD"/> |
| 20 | + <SolidColorBrush x:Key="Button.MouseOver.Background" Color="#AADDDDDD"/> |
| 21 | + <SolidColorBrush x:Key="Button.Pressed.Background" Color="#CCDDDDDD"/> |
| 22 | + <SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/> |
| 23 | + <SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383"/> |
| 24 | + <Style x:Key="CloseButtonStyle" TargetType="{x:Type Button}"> |
| 25 | + <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/> |
| 26 | + <Setter Property="Background" Value="{StaticResource Button.Static.Background}"/> |
| 27 | + <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> |
| 28 | + <Setter Property="BorderThickness" Value="1"/> |
| 29 | + <Setter Property="HorizontalContentAlignment" Value="Center"/> |
| 30 | + <Setter Property="VerticalContentAlignment" Value="Center"/> |
| 31 | + <Setter Property="Padding" Value="1"/> |
| 32 | + <Setter Property="Template"> |
| 33 | + <Setter.Value> |
| 34 | + <ControlTemplate TargetType="{x:Type Button}"> |
| 35 | + <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true"> |
| 36 | + <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> |
| 37 | + </Border> |
| 38 | + <ControlTemplate.Triggers> |
| 39 | + <Trigger Property="IsDefaulted" Value="true"> |
| 40 | + <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/> |
| 41 | + </Trigger> |
| 42 | + <Trigger Property="IsMouseOver" Value="true"> |
| 43 | + <Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/> |
| 44 | + </Trigger> |
| 45 | + <Trigger Property="IsPressed" Value="true"> |
| 46 | + <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/> |
| 47 | + </Trigger> |
| 48 | + <Trigger Property="IsEnabled" Value="false"> |
| 49 | + <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/> |
| 50 | + <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/> |
| 51 | + </Trigger> |
| 52 | + </ControlTemplate.Triggers> |
| 53 | + </ControlTemplate> |
| 54 | + </Setter.Value> |
| 55 | + </Setter> |
| 56 | + </Style> |
| 57 | + </UserControl.Resources> |
| 58 | + <Grid> |
| 59 | + <local:TabBg></local:TabBg> |
| 60 | + |
| 61 | + <Grid WindowChrome.IsHitTestVisibleInChrome="True"> |
| 62 | + <Grid.ColumnDefinitions> |
| 63 | + <ColumnDefinition Width="*"></ColumnDefinition> |
| 64 | + <ColumnDefinition Width="15"></ColumnDefinition> |
| 65 | + </Grid.ColumnDefinitions> |
| 66 | + <Label Name="TabContent" DataContext="{Binding ElementName=_this}" Content="{Binding Title, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#FF454545" Padding="5,0" Margin="5,0,15,0" VerticalAlignment="Center"/> |
| 67 | + <Button Grid.Column="1" Height="15" Width="15" BorderThickness="0" Padding="0" Margin="-15,0,0,0" Click="Close_Click" Style="{DynamicResource CloseButtonStyle}"> |
| 68 | + <Button.OpacityMask> |
| 69 | + <VisualBrush> |
| 70 | + <VisualBrush.Visual> |
| 71 | + <Ellipse Fill="White" Width="15" Height="15" /> |
| 72 | + </VisualBrush.Visual> |
| 73 | + </VisualBrush> |
| 74 | + </Button.OpacityMask> |
| 75 | + <Button.Content> |
| 76 | + <Grid ClipToBounds="True"> |
| 77 | + <Label FontSize="10" Padding="0" Margin="0" RenderTransformOrigin="0.5,0.5" Foreground="#FF787878"> |
| 78 | + <Label.RenderTransform> |
| 79 | + <TransformGroup> |
| 80 | + <ScaleTransform ScaleX="1.5" ScaleY="1.5"/> |
| 81 | + <SkewTransform/> |
| 82 | + <RotateTransform/> |
| 83 | + <TranslateTransform/> |
| 84 | + </TransformGroup> |
| 85 | + </Label.RenderTransform> × |
| 86 | + </Label> |
| 87 | + </Grid> |
| 88 | + </Button.Content> |
| 89 | + </Button> |
| 90 | + </Grid> |
| 91 | + </Grid> |
| 92 | +</UserControl> |
0 commit comments