【发布时间】:2017-02-08 08:21:54
【问题描述】:
我有一个静态属性,在一个静态类中,我已绑定到框架的 Source 属性。它是一种单向绑定。绑定第一次正常工作,但在属性更改时不会更新目标。这是我的 XAML
<Frame x:Name="frmMain" Source="{Binding Source={x:Static currentPage:ActivePages.MainFramePage}, NotifyOnTargetUpdated=True,Mode=OneWay}"/>
这是我的静态类 ActivePages.cs
public static class ActivePages
{
private static Uri mainFramePage;
public static Uri MainFramePage
{
get { return mainFramePage; }
set
{
mainFramePage = value;
MainFramePageChanged?.Invoke(null, new PropertyChangedEventArgs("MainFramePage"));
}
}
public static event EventHandler<PropertyChangedEventArgs> MainFramePageChanged;
}
我关注了this link 和another link当源更改时,我如何更新它?
【问题讨论】: