Xamarin.Forms Guides | Samples

Xamarin.Forms.Frame Class

An element containing a single child, with some framing options.

See Also: Frame

Syntax

[Xamarin.Forms.ContentProperty("Content")]
[Xamarin.Forms.RenderWith(typeof(Xamarin.Forms.Platform._FrameRenderer))]
public class Frame : ContentView, IElementConfiguration<Frame>

Remarks

Frame have a default Layout.Padding of 20.

The following example shows how to construct a new Frame with an Outline color.

C# Example

MainPage = new ContentPage () {
    Content = new Frame {
        Content = new Label { Text = "I'm Framous!" },
        OutlineColor = Color.Silver,
        VerticalOptions = LayoutOptions.CenterAndExpand,
        HorizontalOptions = LayoutOptions.Center
    }
};

XAML for Xamarin.Forms supports the following properties for the Frame class:

PropertyValue
HasShadow

true or false, to indicate whether to show a shadow effect where the platform supports it.

OutlineColor

A color specification, with or without the prefix, "Color". For example, "Color.Red" and "Red" both specify the color red.

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0, 1.4.0.0, 1.5.0.0, 2.0.0.0

The members of Xamarin.Forms.Frame are listed below.

See Also: ContentView

Public Constructors

Initializes a new instance of the Frame class.

Public Fields

static readonly
HasShadowPropertyBindableProperty. Identifies the HasShadow bindable property.
static readonly
OutlineColorPropertyBindableProperty. Identifies the OutlineColor bindable property.

Public Properties

HasShadowBoolean. Gets or sets a flag indicating if the Frame has a shadow displayed. This is a bindable property.
OutlineColorColor. Gets or sets the color of the border of the Frame. This is a bindable property.

Public Methods