DemoItemViewModel.cs 459 B

123456789101112131415
  1. using CommunityToolkit.Mvvm.ComponentModel;
  2. namespace WpfSample.ViewModels {
  3. internal partial class DemoItemViewModel: ObservableObject {
  4. [ObservableProperty]
  5. [NotifyPropertyChangedFor(nameof(Message))]
  6. private string name = string.Empty;
  7. [ObservableProperty]
  8. [NotifyPropertyChangedFor(nameof(Message))]
  9. private string value = string.Empty;
  10. public string Message => $"{Name}-{Value}";
  11. }
  12. }