menu

WinUI

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SfShadow - WinUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SfShadow

    The Shadow control enables to add customizable shadow effects around any UI element of the application such as button, textbox, etc.

    Inheritance
    System.Object
    SfShadow
    Namespace: Syncfusion.UI.Xaml.Core
    Assembly: Syncfusion.Core.WinUI.dll
    Syntax
    public class SfShadow : Control
    Examples

    This example illustrates how to set the Shadow Effect in image element using SfShadow.

    <StackPanel>
    <Syncfusion:SfShadow Color="DarkGray" BlurRadius="8" OffsetX="10" OffsetY="10">
         <Button Height="150" Width="180" Background="Blue"/>
    </Syncfusion:SfShadow>
    

    <Syncfusion:SfShadow Color="DarkGray" BlurRadius="8" OffsetX="10" OffsetY="10"> <Image Height="200" Width="250" Source="Assets\Image\Ellipse_Shadow.png"/> </Syncfusion:SfShadow>

    <Syncfusion:SfShadow Color="DarkGray" BlurRadius="8" OffsetX="10" OffsetY="10"> <Path Data = "M44.5 4L54.0608 33.4114H85L59.9696 51.5886L69.5304 81L44.5 62.8228L19.4696 81L29.0304 51.5886L4 33.4114H34.9392L44.5 4Z" Fill="#FFD700"/> </Syncfusion:SfShadow> </StackPanel>

    Constructors

    SfShadow()

    Initializes a new instance of the SfShadow class.

    Declaration
    public SfShadow()

    Fields

    BlurRadiusProperty

    Identifies the BlurRadius dependency property.

    Declaration
    public static readonly DependencyProperty BlurRadiusProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    ColorProperty

    Identifies the Color dependency property.

    Declaration
    public static readonly DependencyProperty ColorProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    ContentProperty

    Identifies the Content dependency property.

    Declaration
    public static readonly DependencyProperty ContentProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    EnableShadowProperty

    Identifies the EnableShadow dependency property.

    Declaration
    public static readonly DependencyProperty EnableShadowProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    OffsetXProperty

    Identifies the OffsetX dependency property.

    Declaration
    public static readonly DependencyProperty OffsetXProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for the OffsetX dependency property.

    OffsetYProperty

    Identifies the OffsetY dependency property.

    Declaration
    public static readonly DependencyProperty OffsetYProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for the OffsetY dependency property.

    ShadowCornerRadiusProperty

    Identifies the ShadowCornerRadius dependency property.

    Declaration
    public static readonly DependencyProperty ShadowCornerRadiusProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    Properties

    BlurRadius

    Gets or sets the blur radius of the shadow.

    Declaration
    public double BlurRadius { get; set; }
    Property Value
    Type Description
    System.Double

    The default value is 8.

    Color

    Gets or sets the color of the shadow.

    Declaration
    public Color Color { get; set; }
    Property Value
    Type
    Windows.UI.Color

    Content

    Gets or sets the content of the shadow.

    Declaration
    public FrameworkElement Content { get; set; }
    Property Value
    Type
    Microsoft.UI.Xaml.FrameworkElement

    EnableShadow

    Gets or sets the value indicating whether the shadow effect is enabled or not.

    Declaration
    public bool EnableShadow { get; set; }
    Property Value
    Type Description
    System.Boolean

    The default value is true.

    OffsetX

    Gets or sets the X position of the shadow.

    Declaration
    public double OffsetX { get; set; }
    Property Value
    Type Description
    System.Double

    The default value is 4.

    OffsetY

    Gets or sets the Y position of the shadow.

    Declaration
    public double OffsetY { get; set; }
    Property Value
    Type Description
    System.Double

    The default value is 4.

    ShadowCornerRadius

    Gets or sets the corner radius of the shadow.

    Declaration
    public double ShadowCornerRadius { get; set; }
    Property Value
    Type Description
    System.Double

    The default value is 0.

    Methods

    ArrangeOverride(Size)

    Arranges the children in the container.

    Declaration
    protected override Size ArrangeOverride(Size finalSize)
    Parameters
    Type Name Description
    Windows.Foundation.Size finalSize

    Size used to arrange its child.

    Returns
    Type Description
    Windows.Foundation.Size

    Returns the final area of its child.

    OnApplyTemplate()

    Builds the visual tree for the SfShadow.

    Declaration
    protected override void OnApplyTemplate()
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved