【发布时间】:2010-09-12 11:29:39
【问题描述】:
作为my previous question 的后续行动,我想知道如何正确使用透明窗口。如果我将窗口设置为使用透明度,UI 偶尔会出现停止响应。实际发生的是 UI 并没有按应有的方式更新。不出现动画,页面似乎无法导航;但是,如果您看到调试器单击按钮、链接等...确实可以工作。最小化和恢复窗口再次“赶上”用户界面,用户可以继续工作,直到行为恢复。
如果我删除透明边框,则不会发生该行为。我做错了什么还是有一些其他设置、代码等我需要实现才能正确使用透明边框?
这是我对失败代码的窗口声明。
<Window x:Class="MyProject.MainContainer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="WPF APplication" Height="600" Width="800"
xmlns:egc="ControlLibrary" Background="{x:Null}"
BorderThickness="0"
AllowsTransparency="True"
MinHeight="300" MinWidth="400" WindowStyle="None" >
以及没有表现出该行为的代码
<Window x:Class="MyProject.MainContainer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="WPF Application" Height="600" Width="800"
xmlns:egc="ControlLibrary" Background="{x:Null}"
BorderThickness="0"
AllowsTransparency="False"
MinHeight="300" MinWidth="400" WindowStyle="None" >
【问题讨论】:
标签: wpf user-interface transparency