Skip to content

Commit

Permalink
Code style tweaks in 'D2D1AnimatedPixelShaderPanel'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio0694 committed Jul 5, 2024
1 parent 775c8f4 commit bae77d0
Showing 1 changed file with 36 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,24 @@ namespace ComputeSharp.SwapChain.WinUI.Views;
[TemplatePart(Name = "PART_CanvasAnimatedControl", Type = typeof(CanvasAnimatedControl))]
public sealed class D2D1AnimatedPixelShaderPanel : Control
{
/// <summary>
/// The <see cref="DependencyProperty"/> backing <see cref="PixelShaderEffect"/>.
/// </summary>
public static readonly DependencyProperty PixelShaderEffectProperty = DependencyProperty.Register(
nameof(PixelShaderEffect),
typeof(PixelShaderEffect),
typeof(D2D1AnimatedPixelShaderPanel),
new PropertyMetadata(null, OnPixelShaderEffectPropertyChanged));

/// <summary>
/// The <see cref="DependencyProperty"/> backing <see cref="IsPaused"/>.
/// </summary>
public static readonly DependencyProperty IsPausedProperty = DependencyProperty.Register(
nameof(IsPaused),
typeof(bool),
typeof(D2D1AnimatedPixelShaderPanel),
new PropertyMetadata(false, OnIsPausedPropertyChanged));

/// <summary>
/// The wrapped <see cref="CanvasAnimatedControl"/> instance used to render frames.
/// </summary>
Expand All @@ -33,6 +51,24 @@ public D2D1AnimatedPixelShaderPanel()
Unloaded += D2D1AnimatedPixelShaderPanel_Unloaded;
}

/// <summary>
/// Gets or sets the <see cref="Core.Shaders.PixelShaderEffect"/> instance to use to render content.
/// </summary>
public PixelShaderEffect? PixelShaderEffect
{
get => (PixelShaderEffect?)GetValue(PixelShaderEffectProperty);
set => SetValue(PixelShaderEffectProperty, value);
}

/// <summary>
/// Gets or sets whether or not the rendering is paused.
/// </summary>
public bool IsPaused
{
get => (bool)GetValue(IsPausedProperty);
set => SetValue(IsPausedProperty, value);
}

/// <inheritdoc/>
protected override void OnApplyTemplate()
{
Expand Down Expand Up @@ -78,24 +114,6 @@ private void CanvasAnimatedControl_Draw(ICanvasAnimatedControl sender, CanvasAni
args.DrawingSession.DrawImage(this.pixelShaderEffect);
}

/// <summary>
/// Gets or sets the <see cref="Core.Shaders.PixelShaderEffect"/> instance to use to render content.
/// </summary>
public PixelShaderEffect? PixelShaderEffect
{
get => (PixelShaderEffect?)GetValue(PixelShaderEffectProperty);
set => SetValue(PixelShaderEffectProperty, value);
}

/// <summary>
/// The <see cref="DependencyProperty"/> backing <see cref="PixelShaderEffect"/>.
/// </summary>
public static readonly DependencyProperty PixelShaderEffectProperty = DependencyProperty.Register(
nameof(PixelShaderEffect),
typeof(PixelShaderEffect),
typeof(D2D1AnimatedPixelShaderPanel),
new PropertyMetadata(null, OnPixelShaderEffectPropertyChanged));

/// <inheritdoc cref="DependencyPropertyChangedCallback"/>
private static void OnPixelShaderEffectPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
Expand All @@ -114,24 +132,6 @@ private static void OnPixelShaderEffectPropertyChanged(DependencyObject d, Depen
}
}

/// <summary>
/// Gets or sets whether or not the rendering is paused.
/// </summary>
public bool IsPaused
{
get => (bool)GetValue(IsPausedProperty);
set => SetValue(IsPausedProperty, value);
}

/// <summary>
/// The <see cref="DependencyProperty"/> backing <see cref="IsPaused"/>.
/// </summary>
public static readonly DependencyProperty IsPausedProperty = DependencyProperty.Register(
nameof(IsPaused),
typeof(bool),
typeof(D2D1AnimatedPixelShaderPanel),
new PropertyMetadata(false, OnIsPausedPropertyChanged));

/// <inheritdoc cref="DependencyPropertyChangedCallback"/>
private static void OnIsPausedPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
Expand Down

0 comments on commit bae77d0

Please sign in to comment.