项目作者: TianXiaTech

项目描述 :
WPF Aero Glass Lib
高级语言: C#
项目地址: git://github.com/TianXiaTech/BlurWindow.git
创建时间: 2019-10-14T07:28:05Z
项目社区:https://github.com/TianXiaTech/BlurWindow

开源协议:MIT License

下载


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

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

Step2

Replace with

Step3

Make MainWindow inherit from TianXiaTech.BlurWindow

  1. public partial class MainWindow : TianXiaTech.BlurWindow

Step4

Specify background transparency

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

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

  1. <!--Specify acrylic transparency-->
  2. AcrylicOpacity="128"

Additional

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

  1. <Grid>
  2. <Grid.ColumnDefinitions>
  3. <ColumnDefinition Width="*"/>
  4. <ColumnDefinition Width="3*"/>
  5. </Grid.ColumnDefinitions>
  6. <Grid Grid.Column="0">
  7. <Grid.Background>
  8. <SolidColorBrush Color="MediumPurple" Opacity=".5"></SolidColorBrush>
  9. </Grid.Background>
  10. </Grid>
  11. <Grid Grid.Column="1" Background="White"></Grid>
  12. </Grid>


partially transparent

You can also set the picture background directly

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


img background

Title foreground

  1. TitleForeground="Blue"


img background

ControlBox Visibility

  1. ControlBoxVisibility="Visibility.Collapsed"


img background

Icon Visibility

  1. IconVisibility="Visibility.Collapsed"


img background

Title Visibility

  1. TitleVisibility="Visibility.Collapsed"


img background

IsEnable ContextMenu

  1. IsEnableContextMenu="true"


img background

ControlBox Button Visibility

  1. MinimizeVisibility = Visibility.Collapsed
  2. MaximizeVisibility = Visibility.Collapsed
  3. CloseVisibility = Visibility.Collapsed


img background

ContentSpan

  1. 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.