Show / Hide Table of Contents

Class IconExtension

Defines a System.Windows.Markup.MarkupExtension to provide a System.Windows.Style for a System.Windows.Controls.ContentControl representing an icon based on the given IconResourceKey or a System.Windows.Controls.ContentControl if the value is provided for the System.Windows.Controls.ContentControl.ContentProperty.

Inheritance
System.Object
System.Windows.Markup.MarkupExtension
WpfResourceMarkupExtensionBase<System.Windows.Style, IconResourceKey>
IconExtension
WpfResourceMarkupExtensionBase<Style, IconResourceKey>.ProvideValue(IServiceProvider)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Sartorius.SAF.Presentation.Controls.Markup
Assembly: Sartorius.SAF.Presentation.Controls.dll
Syntax
public class IconExtension : WpfResourceMarkupExtensionBase<Style, IconResourceKey>
Remarks

When using a System.Windows.Setter to set the icon you cannot set the icon to the System.Windows.Controls.ContentControl.ContentProperty of a System.Windows.Controls.ContentControl.

Examples

This example illustrates how to use the IconExtension to show an icon.

    <StackPanel Orientation="Horizontal">
    <Button Style="{SAF:Style ButtonToolbar}"
                Content="{SAF:Icon Edit}" />
    <Button Style="{SAF:Style ButtonToolbar}"
                Content="{SAF:Icon Delete}" />
</StackPanel>

The following example shows how to use the IconExtension to set the icon as a System.Windows.Style for a System.Windows.Controls.ContentControl.

    <ContentControl Style="{SAF:Icon Bookmark}" />

Constructors

View Source

IconExtension(IconResourceKey)

Creates a new instance of the IconExtension class.

Declaration
public IconExtension(IconResourceKey resourceKey)
Parameters
Type Name Description
IconResourceKey resourceKey

The resource key.

Methods

View Source

ProvideValue(IServiceProvider)

When implemented in a derived class, returns an object that is provided as the value of the target property for this markup extension.

Declaration
public override object ProvideValue(IServiceProvider serviceProvider)
Parameters
Type Name Description
System.IServiceProvider serviceProvider

A service provider helper that can provide services for the markup extension.

Returns
Type Description
System.Object

The object value to set on the property where the extension is applied.

Overrides
Sartorius.SAF.Presentation.Controls.Markup.WpfResourceMarkupExtensionBase<System.Windows.Style, Sartorius.SAF.Presentation.Controls.Resources.IconResourceKey>.ProvideValue(System.IServiceProvider)

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)

See Also

IconResourceKey
  • View Source
Back to top Generated by DocFX