Skip to content

PropertyChangeHelper

HO-COOH edited this page Mar 22, 2026 · 2 revisions

PropertyChangeHelper --- namespace MvvmHelper

Properties (WinUI3 IDL)

Name IsDependencyProperty Description
N/A No corresponding WinUI3Package IDL runtimeclass was found for this component.

Helper for OneWay binding.

Usage:

  1. Inherit Windows.UI.Xaml.Data.INotifyPropertyChanged in idl
[default_interface]
runtimeclass MyPage : Windows.UI.Xaml.Controls.Page, Windows.UI.Xaml.Data.INotifyPropertyChanged
{
    ...
};
  1. Inherit from this class in the implementation class.
/*MyPage.xaml.h*/
#include <include/PropertyChangeHelper.hpp>

namespace winrt::<MyProject>::implementation
{
    struct MyPage : MyMusicT<MyMusic>, MvvmHelper::PropertyChangeHelper<MyMusic>
    {
        int m_value;
        void Value(int newValue)
        {
            compareAndRaise(m_value, newValue, L"Value");
        };
    }
}

Clone this wiki locally