Class StyleExtension
Defines a MarkupExtension to provide a Style based on the given StyleResourceKey.
Inheritance
StyleExtension
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 ListBox with 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. |