MahApps MetroWindow最高属性绑定问题

问题描述 投票:0回答:1

我正在将MahApps用于我的WPF应用程序,并且在使用Metro窗口时,TopMost属性无法绑定。如果我将其设置为静态值,则可以使用。

<Controls:MetroWindow x:Class="SabreContractSearch.Views.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:prism="http://prismlibrary.com/"
        xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
        xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
        prism:ViewModelLocator.AutoWireViewModel="True"
        Topmost= "{Binding Pin}" Title="{Binding Title}" Height="350" Width="525" Name="FrmMainWindow" >

Pin在这里是布尔属性。

如果我删除都市窗口并为WPF使用常规窗口标签,它将起作用。要使Metro窗口正常工作,还需要添加什么吗?

wpf mahapps.metro
1个回答
0
投票

这是ControlzEx v4.2.1中的错误。有一个Topest hack不能使用SetCurrentValue设置Window的Topmost属性。

WPF0041使用SetCurrentValue设置可变依赖项属性。

使用CLR访问器设置依赖项属性的值将调用SetValue(Property,value)。这将杀死该属性的单向绑定。此规则可能与库代码中最相关,在库代码中,意外设置值可能很难跟踪错误。

© www.soinside.com 2019 - 2024. All rights reserved.