aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Visuals/MetroWindowControl/Style.xaml
blob: 86456921e4a7ed1b3a7533d233542b104760c171 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Converters="clr-namespace:Tango.Visuals.Converters"
    xmlns:local="clr-namespace:Tango.Visuals">


    <Style TargetType="{x:Type local:MetroWindowControl}">
        <Style.Resources>
            <!--Converters-->
            <Converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
            <Converters:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />

            <!--Brushes-->
            <SolidColorBrush x:Key="TitleBackground" Color="#252525"></SolidColorBrush>
            <SolidColorBrush x:Key="Background" Color="#303030"></SolidColorBrush>
            <SolidColorBrush x:Key="TitleForeground" Color="Gainsboro"></SolidColorBrush>
            <SolidColorBrush x:Key="TitleControlsHoverBrush" Color="#404040"></SolidColorBrush>
            <SolidColorBrush x:Key="TitleControlsPressedBrush" Color="#353535"></SolidColorBrush>
            <SolidColorBrush x:Key="TitleInactiveBackground" Color="#505050"></SolidColorBrush>
            <SolidColorBrush x:Key="BorderActiveBrush" Color="#252525"></SolidColorBrush>
            <SolidColorBrush x:Key="BorderInactiveBrush" Color="#505050"></SolidColorBrush>

            <!--Templates-->
            <DataTemplate x:Key="TitleTemplate">
                <StackPanel Orientation="Horizontal">
                    <Image IsHitTestVisible="False" RenderOptions.BitmapScalingMode="Fant" VerticalAlignment="Center" Source="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=Icon}" MaxHeight="{Binding ElementName=PART_GridTitle,Path=Height}" Margin="5 5 0 5" Visibility="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=Icon,Converter={StaticResource NullToVisibilityConverter}}"></Image>
                    <TextBlock IsHitTestVisible="False" Text="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=Title}" FontSize="{Binding RelativeSource={RelativeSource AncestorType=local:MetroWindowControl},Path=TitleFontSize,TargetNullValue=12}" Padding="10 5 5 5" VerticalAlignment="Center" Foreground="{Binding RelativeSource={RelativeSource AncestorType=local:MetroWindowControl},Path=TitleForeground,TargetNullValue={StaticResource TitleForeground},FallbackValue={StaticResource TitleForeground}}"></TextBlock>
                </StackPanel>
            </DataTemplate>

        </Style.Resources>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:MetroWindowControl}">
                    <Grid>
                        <Grid x:Name="PART_MainGrid" Background="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=Background,TargetNullValue={StaticResource Background}, FallbackValue={StaticResource Background}}">
                            <Border BorderThickness="1" BorderBrush="{Binding ElementName=PART_MainGrid,Path=Background}">
                                <Border.Effect>
                                    <DropShadowEffect ShadowDepth="0" Color="Black" Opacity="1" BlurRadius="{TemplateBinding BlurRadius}"></DropShadowEffect>
                                </Border.Effect>
                            </Border>
                            <Grid Background="{Binding ElementName=PART_MainGrid,Path=Background}">
                                <DockPanel LastChildFill="True">
                                    <Grid x:Name="PART_GridTitle" Height="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=TitleHeight,FallbackValue=35}" MinHeight="20" DockPanel.Dock="Top">
                                        <Grid.Style>
                                            <Style TargetType="Grid">
                                                <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=TitleBackground,TargetNullValue={StaticResource TitleBackground}, FallbackValue={StaticResource TitleBackground}}"></Setter>
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=IsActive}" Value="False">
                                                        <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=TitleInactiveBackground,TargetNullValue={StaticResource TitleInactiveBackground},FallbackValue={StaticResource TitleInactiveBackground}}"></Setter>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Grid.Style>
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="Auto"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid>
                                                <Thumb x:Name="PART_ThumbMove" Opacity="0"></Thumb>
                                                <ContentControl ContentTemplate="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=TitleTemplate,TargetNullValue={StaticResource TitleTemplate},FallbackValue={StaticResource TitleTemplate}}"></ContentControl>
                                            </Grid>
                                            <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Grid.Column="1">
                                                <StackPanel.Resources>
                                                    <Style x:Key="titleBarButton" TargetType="{x:Type Button}">
                                                        <Setter Property="Background" Value="Transparent"/>
                                                        <Setter Property="Template">
                                                            <Setter.Value>
                                                                <ControlTemplate TargetType="{x:Type Button}">
                                                                    <Border Background="{TemplateBinding Background}">
                                                                        <ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                                                                    </Border>
                                                                </ControlTemplate>
                                                            </Setter.Value>
                                                        </Setter>
                                                        <Style.Triggers>
                                                            <Trigger Property="IsMouseOver" Value="True">
                                                                <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=TitleControlsHoverBrush,TargetNullValue={StaticResource TitleControlsHoverBrush},FallbackValue={StaticResource TitleControlsHoverBrush}}"></Setter>
                                                            </Trigger>
                                                            <Trigger Property="IsPressed" Value="True">
                                                                <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=TitleControlsPressedBrush,TargetNullValue={StaticResource TitleControlsPressedBrush},FallbackValue={StaticResource TitleControlsPressedBrush}}"></Setter>
                                                            </Trigger>
                                                        </Style.Triggers>
                                                    </Style>
                                                </StackPanel.Resources>
                                                <Button x:Name="PART_ButtonMinimize" Style="{StaticResource titleBarButton}" Width="{Binding ElementName=PART_GridTitle,Path=Height}" Visibility="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=ShowMinimizeButton,Converter={StaticResource BooleanToVisibilityConverter}}">
                                                    <Viewbox Width="10">
                                                        <Path Data="m 0 775.88763 1229.8352 0 0 286.00817 -1229.8352 0 z m 457.61307 -167.93933 71.50204 0 0 66.73524 -71.50204 0 z" Fill="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=TitleForeground,TargetNullValue={StaticResource TitleForeground},FallbackValue={StaticResource TitleForeground}}"></Path>
                                                    </Viewbox>
                                                </Button>
                                                <Button x:Name="PART_ButtonMaximize" Style="{StaticResource titleBarButton}" Width="{Binding ElementName=PART_GridTitle,Path=Height}" Visibility="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=ShowMaximizeButton,Converter={StaticResource BooleanToVisibilityConverter}}">
                                                    <Viewbox Width="10" ClipToBounds="False">
                                                        <Path>
                                                            <Path.Style>
                                                                <Style TargetType="Path">
                                                                    <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter>
                                                                    <Setter Property="Fill" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=TitleForeground,TargetNullValue={StaticResource TitleForeground},FallbackValue={StaticResource TitleForeground}}"></Setter>
                                                                    <Setter Property="Data" Value="m 0 2.369 0 339.601 344.339 0 0 -339.601 z m 334.396 329.675 -324.446 0 0 -256.822 324.445 0 0 256.822 z"/>
                                                                    <Style.Triggers>
                                                                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=WindowState}" Value="Maximized">
                                                                            <Setter Property="Data" Value="m 5.267 9.188 0 0.669 0 5.413 0 12.295 21.383 0 0 -12.295 0 -5.413 0 -0.669 -21.383 0 z m 20.314 17.307 -19.246 0 0 -11.225 19.245 0 0.001 11.225 0 0 z m 19.477051 6.081 0 2.059 1.069 0 0 -2.059 0 -5.413 0 -0.668 -21.3840001 0 0 0.668 0 5.413 0 12.296 3.193 0 0 -1.07 -2.12400005 0 0 -11.226 z"></Setter>
                                                                            <Setter Property="RenderTransform">
                                                                                <Setter.Value>
                                                                                    <TransformGroup>
                                                                                        <ScaleTransform ScaleX="-1" ScaleY="1"></ScaleTransform>
                                                                                        <ScaleTransform ScaleX="1.5" ScaleY="1.5"></ScaleTransform>
                                                                                    </TransformGroup>
                                                                                </Setter.Value>
                                                                            </Setter>
                                                                        </DataTrigger>
                                                                    </Style.Triggers>
                                                                </Style>
                                                            </Path.Style>
                                                        </Path>
                                                    </Viewbox>
                                                </Button>
                                                <Button x:Name="PART_ButtonClose" Style="{StaticResource titleBarButton}" Width="{Binding ElementName=PART_GridTitle,Path=Height}" Visibility="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=ShowCloseButton,Converter={StaticResource BooleanToVisibilityConverter}}">
                                                    <Viewbox Width="10">
                                                        <Polygon Points="357,35.7 321.3,0 178.5,142.8 35.7,0 0,35.7 142.8,178.5 0,321.3 35.7,357 178.5,214.2 321.3,357 357,321.3     214.2,178.5" Fill="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=TitleForeground,TargetNullValue={StaticResource TitleForeground},FallbackValue={StaticResource TitleForeground}}"></Polygon>
                                                    </Viewbox>
                                                </Button>
                                            </StackPanel>
                                        </Grid>
                                    </Grid>
                                    <Grid>
                                        <ContentPresenter Content="{TemplateBinding Content}"></ContentPresenter>

                                        <Grid IsEnabled="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=AllowResize}">
                                            <Thumb x:Name="PART_ThumbResizeRight" Opacity="0" HorizontalAlignment="Right" Width="2" Cursor="SizeWE"></Thumb>
                                            <Thumb x:Name="PART_ThumbResizeBottom" Opacity="0" VerticalAlignment="Bottom" Height="2" Cursor="SizeNS" ></Thumb>
                                            <Thumb x:Name="PART_ThumbResizeBottomRight1" Opacity="0" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="10" Height="2" Cursor="SizeNWSE" ></Thumb>
                                            <Thumb x:Name="PART_ThumbResizeBottomRight2" Opacity="0" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="2" Height="10" Cursor="SizeNWSE" ></Thumb>
                                        </Grid>
                                    </Grid>
                                </DockPanel>

                                <Border x:Name="border" BorderThickness="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=BorderThickness}" IsHitTestVisible="False">
                                    <Border.Style>
                                        <Style TargetType="Border">
                                            <Setter Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=BorderActiveBrush,FallbackValue={StaticResource BorderActiveBrush},TargetNullValue={StaticResource BorderActiveBrush}}"></Setter>
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=IsActive}" Value="False">
                                                    <Setter Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=BorderInactiveBrush,FallbackValue={StaticResource BorderInactiveBrush},TargetNullValue={StaticResource BorderInactiveBrush}}"></Setter>
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </Border.Style>
                                </Border>
                            </Grid>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>