我有一个带有自定义镶边窗口的 WPF 桌面应用程序。一旦我设置了窗口的 WindowChrome 样式属性,在团队中共享该窗口时就会遇到问题:窗口镶边在经典镶边和我的自定义镶边之间切换。
共享屏幕而不是窗口时没有问题。我们在 Windows 11 中遇到此问题,但在 Windows 10 中没有。在完整的 XAML 下方重现此问题:
<Window x:Class="ControlTester.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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"
xmlns:local="clr-namespace:ControlTester"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Window.Style>
<Style TargetType="{x:Type local:MainWindow}">
<Setter Property="WindowChrome.WindowChrome">
<Setter.Value>
<WindowChrome />
</Setter.Value>
</Setter>
</Style>
</Window.Style>
<DockPanel>
<TextBlock Text="This is my window with WindowChrome set"/>
</DockPanel>
</Window>
在 Teams 中共享窗口时(共享内容-> 窗口)...
知道如何解决这个问题吗?