Files
Learn-WinUI-3-Second-Edition/Chapter01/WinUI.SimpleSample/WinUI3.SimpleSample/MainViewModel.cs
T
2023-04-25 09:46:52 -04:00

32 lines
732 B
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WinUI3.SimpleSample
{
public class MainViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private string _name;
public MainViewModel()
{
_name = "Bob Jones";
}
public string Name
{
get { return _name; }
set
{
if (_name == value) return;
_name = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Name)));
}
}
}
}