using CommunityToolkit.Mvvm.ComponentModel;
#if WINDOWS_UWP
using ComputeSharp.Uwp;
#else
using ComputeSharp.WinUI;
#endif
#nullable enable
namespace ComputeSharp.SwapChain.Core.Models;
///
/// A model for a compute shader.
///
/// This can be converted to a record when bindings are fixed, see notes in the XAML code.
public sealed class ComputeShader : ObservableObject
{
///
/// Creates a new instance.
///
/// The name of the shader.
/// The instance to execute.
public ComputeShader(string name, IShaderRunner shaderRunner)
{
Name = name;
ShaderRunner = shaderRunner;
}
///
/// Gets the name of the shader.
///
public string Name { 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);
}
}