Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using CommunityToolkit.Mvvm.ComponentModel;
- using System.ComponentModel;
- using System.Runtime.CompilerServices;
- namespace MM2.ViewModels;
- public partial class MyViewModelx : ObservableObject
- {
- private DateTime _theDate;
- public DateTime theDate
- {
- get { return _theDate; }
- set
- {
- if (_theDate == value) return;
- _theDate = value;
- OnPropertyChanged();
- }
- }
- private int _anInt;
- public int anInt
- {
- get { return _anInt; }
- set
- {
- if (_anInt == value) return;
- _anInt = value;
- OnPropertyChanged();
- }
- }
- public event PropertyChangedEventHandler PropertyChanged;
- protected void OnPropertyChanged([CallerMemberName] string propertyName = "")
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement