123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236 |
- <ResourceDictionary
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:controls="http://firstfloorsoftware.com/ModernUI"
- xmlns:shell="http://schemas.microsoft.com/winfx/2006/xaml/presentation/shell">
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="/FirstFloor.ModernUI;component/Assets/Button.xaml" />
- </ResourceDictionary.MergedDictionaries>
- <!-- additional ModernWindow styles -->
- <!-- empty window style, no backbutton, menu, title links and logo -->
- <Style
- x:Key="MyEmptyWindow"
- BasedOn="{StaticResource {x:Type controls:ModernWindow}}"
- TargetType="{x:Type controls:ModernWindow}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type controls:ModernWindow}">
- <Border x:Name="WindowBorder" Margin="{Binding Source={x:Static shell:SystemParameters2.Current}, Path=WindowNonClientFrameThickness}">
- <Border.Background>
- <SolidColorBrush x:Name="WindowBorderBackground" Color="{DynamicResource WindowBackgroundColor}" />
- </Border.Background>
- <Border.Resources>
- <Storyboard x:Key="BackgroundAnimation">
- <ColorAnimation
- Storyboard.TargetName="WindowBorderBackground"
- Storyboard.TargetProperty="Color"
- To="{DynamicResource WindowBackgroundColor}"
- Duration="0:0:.6" />
- </Storyboard>
- </Border.Resources>
- <Grid>
- <Border BorderBrush="{DynamicResource WindowBorder}" BorderThickness="1">
- <AdornerDecorator>
- <Grid x:Name="LayoutRoot">
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- <RowDefinition Height="15" />
- </Grid.RowDefinitions>
- <!-- window background content -->
- <ContentControl Grid.RowSpan="2" Content="{TemplateBinding BackgroundContent}" />
- <!-- window content -->
- <ContentControl Grid.RowSpan="2" Content="{TemplateBinding Content}" />
- <!-- title blob -->
- <Border
- Grid.RowSpan="2"
- MinWidth="500"
- MinHeight="53"
- HorizontalAlignment="Left"
- VerticalAlignment="Top"
- Background="Transparent"
- RenderTransform="1,0,0,1,-10,-10">
- <TextBlock
- Margin="0,8"
- VerticalAlignment="Center"
- Text="{TemplateBinding Title,
- Converter={StaticResource ToUpperConverter}}"
- FontSize="50"
- DataContext="{TemplateBinding IsTitleVisible}"
- Foreground="White"
- Style="{DynamicResource ModernWindowTitle}"
- Visibility="Visible">
- <TextBlock.Effect>
- <DropShadowEffect
- BlurRadius="2"
- Direction="330"
- Opacity="0.3"
- ShadowDepth="3"
- Color="LightGray" />
- </TextBlock.Effect>
- <TextBlock.OpacityMask>
- <LinearGradientBrush StartPoint="0.5,0.1" EndPoint="0.5,0.9">
- <LinearGradientBrush.GradientStops>
- <GradientStop Offset="0" Color="White" />
- <GradientStop Offset="1" Color="Transparent" />
- </LinearGradientBrush.GradientStops>
- </LinearGradientBrush>
- </TextBlock.OpacityMask>
- </TextBlock>
- </Border>
- <!-- window system buttons -->
- <Grid
- Width="1920"
- Height="20"
- HorizontalAlignment="Left"
- VerticalAlignment="Top"
- Background="Transparent"
- Opacity="1" />
- <StackPanel
- Margin="0,8,6,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Top"
- shell:WindowChrome.IsHitTestVisibleInChrome="True"
- Orientation="Horizontal"
- Visibility="Visible">
- <Button
- Command="{Binding Source={x:Static shell:SystemCommands.MinimizeWindowCommand}}"
- Style="{StaticResource SystemButton}"
- ToolTip="minimize">
- <Button.Content>
- <Grid
- Width="13"
- Height="12"
- RenderTransform="1,0,0,1,0,1">
- <Path
- Width="8"
- Height="7"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="M0,6 L8,6 Z"
- Stroke="{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Button}}"
- StrokeThickness="2" />
- </Grid>
- </Button.Content>
- </Button>
- <Grid Margin="1,0,1,0">
- <Button
- x:Name="Restore"
- Command="{Binding Source={x:Static shell:SystemCommands.RestoreWindowCommand}}"
- Style="{StaticResource SystemButton}"
- ToolTip="restore"
- Visibility="Collapsed">
- <Button.Content>
- <Grid
- Width="13"
- Height="12"
- RenderTransform="1,0,0,1,.5,.5"
- UseLayoutRounding="True">
- <Path
- Width="8"
- Height="8"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="M2,0 L8,0 L8,6 M0,3 L6,3 M0,2 L6,2 L6,8 L0,8 Z"
- Stroke="{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Button}}"
- StrokeThickness="1" />
- </Grid>
- </Button.Content>
- </Button>
- <Button
- x:Name="Maximize"
- Command="{Binding Source={x:Static shell:SystemCommands.MaximizeWindowCommand}}"
- Style="{StaticResource SystemButton}"
- ToolTip="maximize"
- Visibility="Collapsed">
- <Button.Content>
- <Grid Width="13" Height="12">
- <Path
- Width="9"
- Height="8"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="M0,1 L9,1 L9,8 L0,8 Z"
- Stroke="{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Button}}"
- StrokeThickness="2" />
- </Grid>
- </Button.Content>
- </Button>
- </Grid>
- <Button
- Command="{Binding Source={x:Static shell:SystemCommands.CloseWindowCommand}}"
- Style="{StaticResource SystemButton}"
- ToolTip="close"
- Visibility="Visible">
- <Button.Content>
- <Grid
- Width="13"
- Height="12"
- RenderTransform="1,0,0,1,0,1">
- <Path
- Width="8"
- Height="7"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="M0,0 L8,7 M8,0 L0,7 Z"
- Stroke="{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Button}}"
- StrokeThickness="1.5" />
- </Grid>
- </Button.Content>
- </Button>
- </StackPanel>
- <!-- resize grip -->
- <Grid Grid.Row="1">
- <Path
- x:Name="ResizeGrip"
- Width="12"
- Height="12"
- Margin="1"
- HorizontalAlignment="Right"
- Data="F1 M1,10 L3,10 M5,10 L7,10 M9,10 L11,10 M2,9 L2,11 M6,9 L6,11 M10,9 L10,11 M5,6 L7,6 M9,6 L11,6 M6,5 L6,7 M10,5 L10,7 M9,2 L11,2 M10,1 L10,3"
- Stretch="None"
- Stroke="{DynamicResource WindowText}"
- StrokeThickness="1"
- Visibility="Collapsed" />
- </Grid>
- </Grid>
- </AdornerDecorator>
- </Border>
- <Border
- BorderBrush="{DynamicResource WindowBorderActive}"
- BorderThickness="1"
- Visibility="{Binding IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Converter={StaticResource BooleanToVisibilityConverter}}" />
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="WindowState" Value="Maximized">
- <Setter TargetName="Maximize" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="Restore" Property="Visibility" Value="Visible" />
- <Setter TargetName="LayoutRoot" Property="Margin" Value="7" />
- </Trigger>
- <Trigger Property="WindowState" Value="Normal">
- <Setter TargetName="Maximize" Property="Visibility" Value="Visible" />
- <Setter TargetName="Restore" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="ResizeMode" Value="CanResizeWithGrip" />
- <Condition Property="WindowState" Value="Normal" />
- </MultiTrigger.Conditions>
- <Setter TargetName="ResizeGrip" Property="Visibility" Value="Visible" />
- </MultiTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|