SettingsFlyout.IconSource property

Applies to Windows and Windows Phone

Gets or sets the icon image displayed in the SettingsFlyout header.

Syntax


public ImageSource IconSource { get; set; }


<SettingsFlyout IconSource="uri"/>

XAML Values

uri

The URI location of the image source file. In XAML syntax, you can specify what appears to be a relative URI that is relative to a base URI. The base URI is interpreted based on the location of the XAML file that loads it, and uses the ms-appx: scheme implicitly. For more info see Remarks.

Property value

Type: ImageSource

The icon image displayed in the SettingsFlyout header area, typically to the right of the Title. The default is null, which results in no displayed image.

Remarks

Note   Even though the default property value is null, the Microsoft Visual Studio Settings Flyout item template sets the IconSource to your app’s small logo (IconSource="Assets/SmallLogo.png").

The IconSource property is typically set in XAML to take advantage of the built-in conversion from string.

If you do set the IconSource property in code, you can use a BitmapImage object, constructed with the URI that describes the path to a valid image source file. You can also initialize a BitmapSource with a stream, perhaps a stream from a storage file, but that's not typical for a SettingsFlyout UI scenario.

Setting IconSource in XAML

If you set the IconSource property as an attribute in XAML, you are setting the IconSource property using a URI. This behavior relies on underlying type conversion that processes the string as a URI, and calls the equivalent of the BitmapImage(Uri) constructor. The XAML parser interprets any strings that represent a relative URI, using the base URI of the XAML page that is being parsed. For example, if you specify a value "Images/myimage.png" in XAML, that string is interpreted as a relative path suffix that is appended to the base URI location within the app package where the XAML page itself exists.


<SettingsFlyout Width="346" IconSource="Images/myimage.png" />

A property element syntax in XAML is also possible, specifying a BitmapImage object element with valid source as the property value.

Requirements

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

SettingsFlyout
Image.Source

 

 

Show:
© 2014 Microsoft