静的クラス内で、フレームのSourceプロパティにバインドした静的プロパティがあります。これはOneWayバインディングです。バインディングは初めて正しく動作しますが、プロパティが変更されたときにターゲットは更新されません。これは私のXAMLで静的プロパティへの片方向バインディングは、ソースが変更されたときにターゲットを更新しません。
<Frame x:Name="frmMain" Source="{Binding Source={x:Static currentPage:ActivePages.MainFramePage}, NotifyOnTargetUpdated=True,Mode=OneWay}"/>
これは私の静的クラスActivePages.cs 私はthis linkとanother link
どのように私はそれを更新しない、ソースの変更を踏襲
あります?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; }
ブログのリンクにアクセスできません。ソースを指定する構文でフレームソースが読み込まれない – Mavil
いいえ、リンクが壊れているようですが、一時的なものかもしれません。バインディング式の構文は、古いWPFバージョンでは機能しない可能性があります。どのバージョンを使用していますか?また、この答えを見てみることもできます:http://stackoverflow.com/a/41823852/1136211 – Clemens
もちろん、バインディングパスは 'local:ActivePages.MainFramePage'ではなく、' currentPage:ActivePages.MainFramePage'でなければなりません。 – Clemens