diff --git a/samples/ComputeSharp.SwapChain.Core.Shared/ViewModels/MainViewModel.cs b/samples/ComputeSharp.SwapChain.Core.Shared/ViewModels/MainViewModel.cs index e43331a4..076a6dc0 100644 --- a/samples/ComputeSharp.SwapChain.Core.Shared/ViewModels/MainViewModel.cs +++ b/samples/ComputeSharp.SwapChain.Core.Shared/ViewModels/MainViewModel.cs @@ -93,40 +93,40 @@ public sealed partial class MainViewModel : ObservableObject public IReadOnlyList ComputeShaderOptions { get; } = new ShaderRunnerViewModel[] { new( - typeof(ColorfulInfinity), + nameof(ColorfulInfinity), new ShaderRunner(static time => new((float)time.TotalSeconds)), new D2D1ShaderRunner(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))), new( - typeof(FractalTiling), + nameof(FractalTiling), new ShaderRunner(static time => new((float)time.TotalSeconds)), new D2D1ShaderRunner(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))), new( - typeof(MengerJourney), + nameof(MengerJourney), new ShaderRunner(static time => new((float)time.TotalSeconds)), new D2D1ShaderRunner(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))), new( - typeof(Octagrams), + nameof(Octagrams), new ShaderRunner(static time => new((float)time.TotalSeconds)), new D2D1ShaderRunner(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))), new( - typeof(ProteanClouds), + nameof(ProteanClouds), new ShaderRunner(static time => new((float)time.TotalSeconds)), new D2D1ShaderRunner(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))), new( - typeof(TwoTiledTruchet), + nameof(TwoTiledTruchet), new ShaderRunner(static time => new((float)time.TotalSeconds)), new D2D1ShaderRunner(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))), new( - typeof(PyramidPattern), + nameof(PyramidPattern), new ShaderRunner(static time => new((float)time.TotalSeconds)), new D2D1ShaderRunner(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))), new( - typeof(TriangleGridContouring), + nameof(TriangleGridContouring), new ShaderRunner(static time => new((float)time.TotalSeconds)), new D2D1ShaderRunner(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))), - new(typeof(ContouredLayers), new ContouredLayersRunner(), new D2D1ContouredLayersRunner()), + new(nameof(ContouredLayers), new ContouredLayersRunner(), new D2D1ContouredLayersRunner()), new( - typeof(TerracedHills), + nameof(TerracedHills), new ShaderRunner(static time => new((float)time.TotalSeconds)), new D2D1ShaderRunner(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))), }; @@ -197,7 +197,7 @@ public sealed partial class MainViewModel : ObservableObject /// partial void OnSelectedComputeShaderChanged(ShaderRunnerViewModel value) { - this.analyticsService.Log(Event.SelectedComputeShaderChanged, (nameof(value.ShaderType), value.ShaderType.Name)); + this.analyticsService.Log(Event.SelectedComputeShaderChanged, (nameof(value.ShaderType), value.ShaderType)); } /// diff --git a/samples/ComputeSharp.SwapChain.Core.Shared/ViewModels/ShaderRunnerViewModel.cs b/samples/ComputeSharp.SwapChain.Core.Shared/ViewModels/ShaderRunnerViewModel.cs index c3ff0817..eb8d1ef6 100644 --- a/samples/ComputeSharp.SwapChain.Core.Shared/ViewModels/ShaderRunnerViewModel.cs +++ b/samples/ComputeSharp.SwapChain.Core.Shared/ViewModels/ShaderRunnerViewModel.cs @@ -1,4 +1,3 @@ -using System; using CommunityToolkit.Mvvm.ComponentModel; using ComputeSharp.SwapChain.Core.Shaders; #if WINDOWS_UWP @@ -17,10 +16,10 @@ public sealed partial class ShaderRunnerViewModel : ObservableObject /// /// Creates a new instance. /// - /// The instance for the actual shader to execute. + /// The name of the shader type to execute. /// The instance to execute. /// The instance to execute. - public ShaderRunnerViewModel(Type shaderType, IShaderRunner shaderRunner, ID2D1ShaderRunner d2D1ShaderRunner) + public ShaderRunnerViewModel(string shaderType, IShaderRunner shaderRunner, ID2D1ShaderRunner d2D1ShaderRunner) { ShaderType = shaderType; ShaderRunner = shaderRunner; @@ -28,9 +27,9 @@ public sealed partial class ShaderRunnerViewModel : ObservableObject } /// - /// Gets the instance for the actual shader to execute. + /// Gets the name of the shader type to execute. /// - public Type ShaderType { get; } + public string ShaderType { get; } /// /// Gets the instance to execute.