惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tailwind CSS Blog
S
Secure Thoughts
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Tor Project blog
T
Tenable Blog
Know Your Adversary
Know Your Adversary
Webroot Blog
Webroot Blog
V
Vulnerabilities – Threatpost
WordPress大学
WordPress大学
S
Security @ Cisco Blogs
J
Java Code Geeks
S
SegmentFault 最新的问题
A
Arctic Wolf
Simon Willison's Weblog
Simon Willison's Weblog
T
Threatpost
Forbes - Security
Forbes - Security
爱范儿
爱范儿
T
The Blog of Author Tim Ferriss
S
Securelist
MongoDB | Blog
MongoDB | Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
月光博客
月光博客
Blog — PlanetScale
Blog — PlanetScale
博客园 - 【当耐特】
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
SecWiki News
SecWiki News
aimingoo的专栏
aimingoo的专栏
腾讯CDC
U
Unit 42
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
Latest news
Latest news
I
InfoQ
V2EX - 技术
V2EX - 技术
The Cloudflare Blog
V
V2EX
The Register - Security
The Register - Security
博客园 - Franky
Security Archives - TechRepublic
Security Archives - TechRepublic
Security Latest
Security Latest
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
云风的 BLOG
云风的 BLOG
Jina AI
Jina AI
Microsoft Security Blog
Microsoft Security Blog
小众软件
小众软件
N
Netflix TechBlog - Medium
量子位
M
MIT News - Artificial intelligence

博客园 - dalgleish

C# Avalonia 23- OpenGL- 例子通用类 C# Avalonia 22- SoundAndVideo- SpeechVoiceTest C# Avalonia 22- SoundAndVideo- SpeechRecognition C# Avalonia 22- SoundAndVideo- SpeechSynthesis C# Avalonia 22- SoundAndVideo- CodePlayback C# Avalonia 22- SoundAndVideo- SoundPlayerTest C# Avalonia 21- MenusAndToolbars- RibbonTest C# Avalonia 21- MenusAndToolbars- ProportionalStatusBar C# Avalonia 21- MenusAndToolbars- BasicToolbar C# Avalonia 21- MenusAndToolbars- ToolBar/Ribbon开源项目介绍和修复 C# Avalonia 21- MenusAndToolbars- SidebarMenu C# Avalonia 21- MenusAndToolbars- MixedMenus C# Avalonia 20 - WindowsMenu- 魔改Hyperlink - 使用例子 C# Avalonia 20 - WindowsMenu- 魔改Hyperlink C# Avalonia 20 - WindowsMenu- WebViewTest C# Avalonia 20 - WindowsMenu- WebView C# Avalonia 20 - WindowsMenu- ModernWindowTest C# Avalonia 20 - WindowsMenu- ModernWindow C# Avalonia 20 - WindowsMenu- TransparentWithShapes C# Avalonia 20 - WindowsMenu- OpenFileTest C# Avalonia 20 - WindowsMenu- SavePostion C# Avalonia 20 - WindowsMenu- CenterScreen C# Avalonia 19- DataBinding- DataGridGrouping C# Avalonia 19- DataBinding- DirectoryTreeView C# Avalonia 19- DataBinding- BoundTreeView C# Avalonia 19- DataBinding- CustomListViewTest
C# Avalonia 20 - WindowsMenu- TransparentBackground
dalgleish · 2026-03-21 · via 博客园 - dalgleish

TransparentBackground.axaml代码

<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        Height="300" Width="300"
        SystemDecorations="None"
        TransparencyLevelHint="AcrylicBlur,Transparent"
        Background="Transparent"
        x:Class="AvaloniaUI.TransparentBackground"
        Title="TransparentBackground"
        PointerPressed="Window_PointerPressed">
    
    <Window.Background>
        <ImageBrush Source="avares://AvaloniaUI/Resources/Images/shapes.png"
                    Stretch="UniformToFill"
                    Opacity="0.7"/>
    </Window.Background>

    <Grid RowDefinitions="*,*,*,*">
        <Button Margin="20">A Sample Button</Button>
        <Button Margin="20"
                Grid.Row="2"
                Click="cmdClose_Click">
            Close
        </Button>
    </Grid>
</Window>

TransparentBackground.axaml.cs代码

using Avalonia;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;

namespace AvaloniaUI;

public partial class TransparentBackground : Window
{
    public TransparentBackground()
    {
        InitializeComponent();
    }

    private void Window_PointerPressed(object? sender, PointerPressedEventArgs e)
    {
        if (e.GetCurrentPoint(this).Properties.IsLeftButtonPressed)
            BeginMoveDrag(e);
    }

    private void cmdClose_Click(object? sender, RoutedEventArgs e)
    {
        Close();
    }
}

运行效果

image