Files
stgsharp/StgSharp.UserInterface/Framework/View.StateChangeCommand.cs
T

32 lines
858 B
C#

// -----------------------------------------------------------------------------
// file="View.StateChangeCommand"
// Project: StgSharp
// Copyright (c) Nitload.
// SPDX-License-Identifier: MIT
// -----------------------------------------------------------------------------
using System;
namespace StgSharp.UserInterface
{
public abstract record StateChangeCommand
{
protected StateChangeCommand(
string statePath
)
{
StatePath = string.IsNullOrWhiteSpace(statePath) ?
throw new ArgumentException("Value cannot be null or whitespace.", nameof(statePath)) :
statePath;
}
public object? Value { get; init; }
public Guid CommandId { get; init; } = Guid.NewGuid();
public string StatePath { get; init; }
}
}