Xamarin.Android

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class BackgroundGradient

    Show / Hide Table of Contents

    Class BackgroundGradient

    Represents the background gradient effect.

    Inheritance
    System.Object
    OwnerHolder
    XDLSSerializableBase
    BackgroundGradient
    Implements
    IXDLSSerializable
    Inherited Members
    XDLSSerializableBase.IXDLSSerializable.WriteXmlAttributes(IXDLSAttributeWriter)
    XDLSSerializableBase.IXDLSSerializable.WriteXmlContent(IXDLSContentWriter)
    XDLSSerializableBase.IXDLSSerializable.ReadXmlAttributes(IXDLSAttributeReader)
    XDLSSerializableBase.IXDLSSerializable.ReadXmlContent(IXDLSContentReader)
    XDLSSerializableBase.IXDLSSerializable.RestoreReference(String, Int32)
    XDLSSerializableBase.CloneImpl()
    XDLSSerializableBase.WriteXmlContent(IXDLSContentWriter)
    XDLSSerializableBase.ReadXmlContent(IXDLSContentReader)
    XDLSSerializableBase.InitXDLSHolder()
    XDLSSerializableBase.RestoreReference(String, Int32)
    XDLSSerializableBase.IXDLSSerializable.XDLSHolder
    XDLSSerializableBase.XDLSHolder
    OwnerHolder.m_doc
    OwnerHolder.Document
    Namespace: Syncfusion.DocIO.DLS
    Assembly: Syncfusion.DocIO.Portable.dll
    Syntax
    public class BackgroundGradient : XDLSSerializableBase, IXDLSSerializable
    Examples
    private void Button1_Click(System.Object sender, System.EventArgs e)
    {
        //Create an instance of WordDocument class 
        WordDocument document = new WordDocument();
        //Set the background type of the document
        document.Background.Type = BackgroundType.Gradient;
        //Set the first color of the background gradient of the document
        document.Background.Gradient.Color1 = Color.AliceBlue;
        //Set the second color of the background gradient of the document
        document.Background.Gradient.Color2 = Color.Purple;
        //Set the first shading style of the background gradient of the document
        document.Background.Gradient.ShadingStyle = GradientShadingStyle.DiagonalDown;
        //Set the first shading variant of the background gradient of the document
        document.Background.Gradient.ShadingVariant = GradientShadingVariant.ShadingMiddle;
        //Add one section with one paragraph to the document
        document.EnsureMinimal();
        //Add the text range to the last paragraph of the section
        document.LastParagraph.AppendText("Hello World!");
        //Save the document in the given name and format
        document.Save("Sample.docx", FormatType.Docx);
        //Release the resources occupied by WordDocument instance
        document.Close();
    }
    Private Sub button_Click(sender As Object, e As EventArgs)
        'Create an instance of WordDocument class 
        Dim document As New WordDocument()
        'Set the background type of the document
        document.Background.Type = BackgroundType.Gradient
        'Set the first color of the background gradient of the document
        document.Background.Gradient.Color1 = Color.AliceBlue
        'Set the second color of the background gradient of the document
        document.Background.Gradient.Color2 = Color.Purple
        'Set the first shading style of the background gradient of the document
        document.Background.Gradient.ShadingStyle = GradientShadingStyle.DiagonalDown
        'Set the first shading variant of the background gradient of the document
        document.Background.Gradient.ShadingVariant = GradientShadingVariant.ShadingMiddle
        'Add one section with one paragraph to the document
        document.EnsureMinimal()
        'Add the text range to the last paragraph of the section
        document.LastParagraph.AppendText("Hello World!")
        'Save the document in the given name and format
        document.Save("Sample.docx", FormatType.Docx)
        'Release the resources occupied by WordDocument instance
        document.Close()
    End Sub

    Constructors

    BackgroundGradient()

    Initializes a new instance of the BackgroundGradient class.

    Declaration
    public BackgroundGradient()

    Properties

    Color1

    Gets or sets the first color for gradient effect.

    Declaration
    public Color Color1 { get; set; }
    Property Value
    Type Description
    Color

    The first for the gradient effect.

    Color2

    Gets or sets the second color for gradient effect.

    Declaration
    public Color Color2 { get; set; }
    Property Value
    Type Description
    Color

    The second for the gradient effect.

    ShadingStyle

    Gets or sets the shading style for gradient effect.

    Declaration
    public GradientShadingStyle ShadingStyle { get; set; }
    Property Value
    Type Description
    GradientShadingStyle

    The GradientShadingStyle member that represents the shading style for gradient effect.

    ShadingVariant

    Gets or sets the shading variants for gradient effect.

    Declaration
    public GradientShadingVariant ShadingVariant { get; set; }
    Property Value
    Type Description
    GradientShadingVariant

    The GradientShadingVariant member that represents the shading variants for gradient effect.

    Methods

    Clone()

    Creates the duplicate copy of the background gradient.

    Declaration
    public BackgroundGradient Clone()
    Returns
    Type Description
    BackgroundGradient

    The BackgroundGradient which is a copy of current gradient.

    ReadXmlAttributes(IXDLSAttributeReader)

    Reads object data from xml attributes.

    Declaration
    protected override void ReadXmlAttributes(IXDLSAttributeReader reader)
    Parameters
    Type Name Description
    IXDLSAttributeReader reader

    The IXDLSAttributeReader object.

    Overrides
    XDLSSerializableBase.ReadXmlAttributes(IXDLSAttributeReader)

    WriteXmlAttributes(IXDLSAttributeWriter)

    Writes object data as xml attributes.

    Declaration
    protected override void WriteXmlAttributes(IXDLSAttributeWriter writer)
    Parameters
    Type Name Description
    IXDLSAttributeWriter writer

    The IXDLSAttributeWriter object.

    Overrides
    XDLSSerializableBase.WriteXmlAttributes(IXDLSAttributeWriter)

    Implements

    IXDLSSerializable
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved