check point
This commit is contained in:
21
VisionBuilder.UI.Common/ExampleMainViewModel.cs
Normal file
21
VisionBuilder.UI.Common/ExampleMainViewModel.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Diagnostics.Metrics;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
|
||||
namespace VisionBuilder.UI.Common;
|
||||
|
||||
public partial class ExampleMainViewModel : ObservableObject
|
||||
{
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyCanExecuteChangedFor(nameof(IncrementCommand))]
|
||||
private int _counter;
|
||||
|
||||
[RelayCommand(CanExecute = nameof(CanIncrement))]
|
||||
private void Increment()
|
||||
{
|
||||
Counter++;
|
||||
}
|
||||
|
||||
private bool CanIncrement => this.Counter < 10;
|
||||
}
|
||||
Reference in New Issue
Block a user