From 8da49f2b21837939a5f55475588de8737ec53127 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Sun, 5 Jul 2020 12:39:24 -0300 Subject: [PATCH] add docs. --- .../Media/AcrylicBackgroundSource.cs | 12 ++++++ .../Media/ExperimentalAcrylicMaterial.cs | 37 +++++++++++++++++++ .../Media/IExperimentalAcrylicMaterial.cs | 18 +++++++++ 3 files changed, 67 insertions(+) diff --git a/src/Avalonia.Visuals/Media/AcrylicBackgroundSource.cs b/src/Avalonia.Visuals/Media/AcrylicBackgroundSource.cs index d902752f85..34cede4018 100644 --- a/src/Avalonia.Visuals/Media/AcrylicBackgroundSource.cs +++ b/src/Avalonia.Visuals/Media/AcrylicBackgroundSource.cs @@ -1,8 +1,20 @@ namespace Avalonia.Media { + /// + /// Background Sources for Acrylic. + /// public enum AcrylicBackgroundSource { + /// + /// The acrylic has no background. + /// None, + + /// + /// Cuts through all render layers to reveal the window background. + /// This means if your window is transparent or blurred it + /// will be blended with the material. + /// Digger } } diff --git a/src/Avalonia.Visuals/Media/ExperimentalAcrylicMaterial.cs b/src/Avalonia.Visuals/Media/ExperimentalAcrylicMaterial.cs index 19498b7f86..6b699acd2e 100644 --- a/src/Avalonia.Visuals/Media/ExperimentalAcrylicMaterial.cs +++ b/src/Avalonia.Visuals/Media/ExperimentalAcrylicMaterial.cs @@ -47,54 +47,91 @@ namespace Avalonia.Media public static readonly StyledProperty TintColorProperty = AvaloniaProperty.Register(nameof(TintColor)); + /// + /// Defines the property. + /// public static readonly StyledProperty BackgroundSourceProperty = AvaloniaProperty.Register(nameof(BackgroundSource)); + /// + /// Defines the property. + /// public static readonly StyledProperty TintOpacityProperty = AvaloniaProperty.Register(nameof(TintOpacity), 0.8); + /// + /// Defines the property. + /// public static readonly StyledProperty MaterialOpacityProperty = AvaloniaProperty.Register(nameof(MaterialOpacity), 0.5); + /// + /// Defines the property. + /// public static readonly StyledProperty PlatformTransparencyCompensationLevelProperty = AvaloniaProperty.Register(nameof(PlatformTransparencyCompensationLevel), 0.0); + /// + /// Defines the property. + /// public static readonly StyledProperty FallbackColorProperty = AvaloniaProperty.Register(nameof(FallbackColor)); /// public event EventHandler Invalidated; + /// + /// Gets or Sets the BackgroundSource . + /// public AcrylicBackgroundSource BackgroundSource { get => GetValue(BackgroundSourceProperty); set => SetValue(BackgroundSourceProperty, value); } + /// + /// Gets or Sets the TintColor. + /// public Color TintColor { get => GetValue(TintColorProperty); set => SetValue(TintColorProperty, value); } + /// + /// Gets or Sets the Tint Opacity. + /// public double TintOpacity { get => GetValue(TintOpacityProperty); set => SetValue(TintOpacityProperty, value); } + /// + /// Gets or Sets the Fallback Color. + /// This is used on rendering plaforms that dont support acrylic. + /// public Color FallbackColor { get => GetValue(FallbackColorProperty); set => SetValue(FallbackColorProperty, value); } + /// + /// Gets or Sets the MaterialOpacity. + /// This makes the material more or less opaque. + /// public double MaterialOpacity { get => GetValue(MaterialOpacityProperty); set => SetValue(MaterialOpacityProperty, value); } + /// + /// Gets or Sets the PlatformTransparencyCompensationLevel. + /// This value defines the minimum that can be used. + /// It means material opacity is re-scaled from this value to 1. + /// public double PlatformTransparencyCompensationLevel { get => GetValue(PlatformTransparencyCompensationLevelProperty); diff --git a/src/Avalonia.Visuals/Media/IExperimentalAcrylicMaterial.cs b/src/Avalonia.Visuals/Media/IExperimentalAcrylicMaterial.cs index a656c75d46..e71584258a 100644 --- a/src/Avalonia.Visuals/Media/IExperimentalAcrylicMaterial.cs +++ b/src/Avalonia.Visuals/Media/IExperimentalAcrylicMaterial.cs @@ -1,15 +1,33 @@ namespace Avalonia.Media { + /// + /// Experimental Interface for producing Acrylic-like materials. + /// public interface IExperimentalAcrylicMaterial { + /// + /// Gets the of the material. + /// AcrylicBackgroundSource BackgroundSource { get; } + /// + /// Gets the TintColor of the material. + /// Color TintColor { get; } + /// + /// Gets the TintOpacity of the material. + /// double TintOpacity { get; } + /// + /// Gets the effective material color. + /// Color MaterialColor { get; } + /// + /// Gets the fallback color. + /// Color FallbackColor { get; } } }