Skip to content

TianXiaTech/BlurWindow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BlurWindow

logo

GitHub stars All releases Github forks All issues

WPF Aero Glass Lib

Only Windows 10 and Windows 11(before 22H2) are supported Support Windows 10 and Windows 11

The window style is located in Theme.xaml and can be modified by yourself.
This project is part of TianXiaTech

Nuget

PM>Install-Package BlurWindow -Version 7.0.1

Usage

Step 1

import xaml prefix

xmlns:blurwindow="clr-namespace:TianXiaTech;assembly=BlurWindow";

Step2

Replace <Window></Window> with <blurwindow:BlurWindow></blurwindow:BlurWindow>

Step3

Make MainWindow inherit from TianXiaTech.BlurWindow

public partial class MainWindow : TianXiaTech.BlurWindow

Step4

Specify background transparency

<Window.Background>
    <!--Specify transparency here-->
    <SolidColorBrush Color="White" Opacity=".5"/>  
 </Window.Background>

If OS Version is Windows 11(greater than 22H2), the following additional properties need to be specified

   <!--Specify acrylic transparency-->
   AcrylicOpacity="128"

Additional

You can set the window to be partially transparent, like below

<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="3*"/>
    </Grid.ColumnDefinitions>

    <Grid  Grid.Column="0">
        <Grid.Background>
            <SolidColorBrush Color="MediumPurple" Opacity=".5"/>
        </Grid.Background>
    </Grid>

    <Grid Grid.Column="1" Background="White"/>
</Grid>

partially transparent

You can also set the picture background directly

<Grid>
    <Grid.Background>
        <ImageBrush ImageSource="yasuo.jpg" Stretch="UniformToFill" Opacity=".5"/>
    </Grid.Background>
</Grid>

img background

Title foreground

        TitleForeground="Blue"

img background

ControlBox Visibility

        ControlBoxVisibility="Visibility.Collapsed"

img background

Icon Visibility

        IconVisibility="Visibility.Collapsed"

img background

Title Visibility

        TitleVisibility="Visibility.Collapsed"

img background

IsEnable ContextMenu

        IsEnableContextMenu="true"

img background

ControlBox Button Visibility

        MinimizeVisibility = Visibility.Collapsed
        MaximizeVisibility = Visibility.Collapsed
        CloseVisibility = Visibility.Collapsed

img background

ContentSpan

        ContentSpan = "true"

img background

Sample screenshot

Opacity 0.8

demo img

Opacity 0.5

demo img

Todo

  • Use WPF attached property

Thanks

Project reference https://github.com/TranslucentTB/TranslucentTB and https://github.com/riverar/sample-win32-acrylicblur

License

MIT License.