mirror of
https://github.com/amwx/FluentAvalonia.git
synced 2026-10-18 13:10:47 +08:00
47 lines
994 B
C#
47 lines
994 B
C#
using System.ComponentModel;
|
|
using System.Diagnostics;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Windows.Input;
|
|
|
|
namespace FASandbox;
|
|
|
|
// This is set up for quick testing purposes.
|
|
|
|
public class MainWindowViewModel : INotifyPropertyChanged
|
|
{
|
|
public MainWindowViewModel()
|
|
{
|
|
|
|
}
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
|
|
private bool RaiseAndSetIfChanged<T>(ref T field, T value, [CallerMemberName]string propName = "")
|
|
{
|
|
if (!EqualityComparer<T>.Default.Equals(field, value))
|
|
{
|
|
field = value;
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propName));
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public class Command : ICommand
|
|
{
|
|
public event EventHandler CanExecuteChanged;
|
|
|
|
public bool CanExecute(object parameter)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public void Execute(object parameter)
|
|
{
|
|
Debug.WriteLine("FIRED");
|
|
}
|
|
}
|
|
|