Last active
April 25, 2022 05:15
-
-
Save hilapon/95cdd933a3afc440bec3b162adeca950 to your computer and use it in GitHub Desktop.
ビューモデルをプロジェクトに追加
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.ComponentModel; | |
namespace MauiApp1 { | |
internal class MainViewModel : INotifyPropertyChanged { | |
public event PropertyChangedEventHandler PropertyChanged; | |
#region プロパティ | |
private string _CounterText; | |
public string CounterText { | |
get => _CounterText; | |
private set { | |
if (_CounterText == value) return; | |
_CounterText = value; | |
OnPropertyChanged(nameof(CounterText)); | |
} | |
} | |
#endregion | |
protected virtual void OnPropertyChanged(string propertyName) { | |
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment