Browse Source

Add SeedCardViewModel

pull/165/head
Ionite 1 year ago
parent
commit
0b90944d50
No known key found for this signature in database
  1. 27
      StabilityMatrix.Avalonia/ViewModels/Inference/SeedCardViewModel.cs

27
StabilityMatrix.Avalonia/ViewModels/Inference/SeedCardViewModel.cs

@ -0,0 +1,27 @@
using System;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using StabilityMatrix.Avalonia.Controls;
using StabilityMatrix.Core.Attributes;
namespace StabilityMatrix.Avalonia.ViewModels.Inference;
[View(typeof(SeedCard))]
public partial class SeedCardViewModel : ViewModelBase
{
[ObservableProperty, NotifyPropertyChangedFor(nameof(RandomizeButtonToolTip))]
private bool isRandomizeEnabled;
[ObservableProperty]
private long seed;
public string RandomizeButtonToolTip => IsRandomizeEnabled
? "Seed is locked"
: "Randomizing Seed on each run";
[RelayCommand]
public void GenerateNewSeed()
{
Seed = Random.Shared.NextInt64();
}
}
Loading…
Cancel
Save