Class StyleExtension
Defines a System.Windows.Markup.MarkupExtension to provide a System.Windows.Style based on the given StyleResourceKey.
Inheritance
System.Object
System.Windows.Markup.MarkupExtension
StyleExtension
System.Windows.Markup.MarkupExtension.ProvideValue(System.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 StyleExtension : WpfResourceMarkupExtensionBase<Style, StyleResourceKey>
Examples
This example illustrates how to use the StyleExtension for a System.Windows.Controls.ListBox with System.Windows.Controls.ListBoxItem that should have a selection indication
<ListBox Grid.Row="6" Grid.Column="1" Style="{SAF:Style ListBox}"
Background="{SAF:Brush Background01}" SelectionMode="Extended"
ItemContainerStyle="{SAF:Style ListBoxItem}" Grid.ColumnSpan="2" Margin="20,0,0,0">
<ListBoxItem>Item 1</ListBoxItem>
<ListBoxItem>Item 2</ListBoxItem>
<ListBoxItem IsEnabled="False">Item 3</ListBoxItem>
</ListBox>
Constructors
View SourceStyleExtension(StyleResourceKey)
Creates a new instance of the StyleExtension class.
Declaration
public StyleExtension(StyleResourceKey resourceKey)
Parameters
Type | Name | Description |
---|---|---|
StyleResourceKey | resourceKey | The resource key. |