Skip to content

Languages

This page is also available in 简体中文 and 日本語.

[BindableBase]

For classes that do not inherit Prism.Mvvm.BindableBase (and do not already implement INotifyPropertyChanged through a base type), the generator can emit PropertyChanged, SetProperty<T>, RaisePropertyChanged, and OnPropertyChanged helpers so you can write Prism-style setters.

csharp
[BindableBase]
public partial class SimpleViewModel
{
    private string _message = "Hello";

    public string Message
    {
        get => _message;
        set => SetProperty(ref _message, value);
    }
}

The containing type must be partial (PSG0004). If the type already inherits BindableBase or another INPC base, no code is generated.

Released under the MIT License.

Released under the MIT License.