Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

minimize maximize restore wpf buttons

<!--Close Button-->
<Button x:Name="Close" Style="{StaticResource TitleButton}"
        Command="{Binding Source={x:Static SystemCommands.CloseWindowCommand}}"
        CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}">
    <Grid Width="30" Height="25">
        <Path x:Name="Cross" Data="M0,0 L1,1 M0,1 L1,0" Stretch="Fill" Width="8" Height="8"
              Stroke="{Binding Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}, Mode=FindAncestor}}" StrokeThickness="2" />
    </Grid>
</Button>

<!--Maximize Button-->
<Button x:Name="Maximize" Style="{StaticResource TitleButton}"
        Command="{Binding Source={x:Static SystemCommands.MaximizeWindowCommand}}"
        CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" >
    <Grid Width="30" Height="25">
        <Path Data="M0,1 L9,1 L9,8 L0,8 Z" Width="9" Height="8" VerticalAlignment="Center" HorizontalAlignment="Center"
              Stroke="{Binding Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}, Mode=FindAncestor}}" StrokeThickness="2"  />
    </Grid>
</Button>

<!--Restore Button-->
<Button x:Name="Restore" Visibility="Collapsed" Style="{StaticResource TitleButton}"
        Command="{Binding Source={x:Static SystemCommands.RestoreWindowCommand}}"
        CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}">
    <Grid Width="30" Height="25" UseLayoutRounding="True" RenderTransform="1,0,0,1,.5,.5">
        <Path Data="M2,0 L8,0 L8,6 M0,3 L6,3 M0,2 L6,2 L6,8 L0,8 Z" Width="8" Height="8" VerticalAlignment="Center" HorizontalAlignment="Center"
              Stroke="{Binding Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}, Mode=FindAncestor}}" StrokeThickness="1"  />
    </Grid>
</Button>

<!--Minimize Button-->
<Button x:Name="Minimize" Style="{StaticResource TitleButton}"
        Command="{Binding Source={x:Static SystemCommands.MinimizeWindowCommand}}"
        CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}">
    <Grid Width="30" Height="25">
        <Path Data="M9,0 L8,1 8,1 8,1 0,1 0,1 z" Width="9" Height="9" VerticalAlignment="Bottom" HorizontalAlignment="Center"
              Stroke="{Binding Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}, Mode=FindAncestor}}" StrokeThickness="2" />
    </Grid>
</Button>
Comment

PREVIOUS NEXT
Code Example
Csharp :: what are access modifiers in c# 
Csharp :: unity class 
Csharp :: disable button in android studio 
Csharp :: How to make game object transparent in unity 
Csharp :: c# calculate sum of list 
Csharp :: unity send post request json 
Csharp :: bundle.config in mvc is missing 
Csharp :: How to find out if a file exists in C# / .NET? 
Csharp :: c# today without time 
Csharp :: how do you make a 2D object follow another 2D object in unity 2D 
Csharp :: append multi lines to file linux 
Csharp :: columndefinition wpf 
Csharp :: dynamic group by expression C# 
Csharp :: unity get component in parent 
Csharp :: uri file path c# 
Csharp :: c# wpf get clipboard text 
Csharp :: c# loop through dictionary 
Csharp :: ray casting unity 
Csharp :: All Possible SubString of string 
Csharp :: set current date to textbox in asp.net 
Csharp :: entity framework core genetare class using existing database 
Csharp :: unity2d movement 
Csharp :: to list c# 
Csharp :: c# normalize value 
Csharp :: deploy .net core 
Csharp :: c# move form without border 
Csharp :: c# lambdas 
Csharp :: return stream from file c# 
Csharp :: registry keys and values 
Csharp :: c# tab select tab 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =