using System; using CommunityToolkit.Mvvm.ComponentModel; #if WINDOWS_UWP using ComputeSharp.Uwp; #else using ComputeSharp.WinUI; #endif namespace ComputeSharp.SwapChain.Core.ViewModels; /// /// A viewmodel for a compute shader. /// public sealed class ShaderRunnerViewModel : ObservableObject { /// /// Creates a new instance. /// /// The instance for the actual shader to execute. /// The instance to execute. public ShaderRunnerViewModel(Type shaderType, IShaderRunner shaderRunner) { ShaderType = shaderType; ShaderRunner = shaderRunner; } /// /// Gets the instance for the actual shader to execute. /// public Type ShaderType { get; } /// /// Gets the instance to execute. /// public IShaderRunner ShaderRunner { get; } private bool isSelected; /// /// Gets or sets whether the current shader is selected. /// public bool IsSelected { get => this.isSelected; set => SetProperty(ref this.isSelected, value); } }