using CommunityToolkit.Mvvm.ComponentModel; using ComputeSharp.SwapChain.Core.Shaders; using ComputeSharp.WinUI; namespace ComputeSharp.SwapChain.Core.ViewModels; /// /// A viewmodel for a compute shader. /// public sealed partial class ShaderRunnerViewModel : ObservableObject { /// /// Creates a new instance. /// /// The name of the shader type to execute. /// The instance to execute. /// The instance to execute. public ShaderRunnerViewModel(string shaderType, IShaderRunner shaderRunner, PixelShaderEffect pixelShaderEffect) { ShaderType = shaderType; ShaderRunner = shaderRunner; PixelShaderEffect = pixelShaderEffect; } /// /// Gets the name of the shader type to execute. /// public string ShaderType { get; } /// /// Gets the instance to execute. /// public IShaderRunner ShaderRunner { get; } /// /// Gets the instance to execute. /// public PixelShaderEffect PixelShaderEffect { get; } /// /// Gets or sets whether the current shader is selected. /// [ObservableProperty] private bool isSelected; }