You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
740 B
28 lines
740 B
1 year ago
|
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();
|
||
|
}
|
||
|
}
|