Class UISettings
Implements functionality for Storing and Restoring UISettings.
Namespace: Sartorius.SAF.Presentation.Settings
Assembly: Sartorius.SAF.Presentation.dll
Syntax
public static class UISettings
Fields
View SourceHasUISettingsProperty
Dependency Property that indicates if a FrameWorkElement has UISettings.
Declaration
public static readonly DependencyProperty HasUISettingsProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
Properties
View SourceSettings
Gets or sets the Dictionary of settings.
Declaration
public static Dictionary<string, object> Settings { get; set; }
Property Value
| Type | Description |
|---|---|
| Dictionary<string, object> |
SettingsKey
Gets the settings key which is used to save the UI Settings.
Declaration
public static string SettingsKey { get; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
Value is "UISettings"
Views
Gets or sets the Views that have UISettings.
Declaration
public static List<WeakReference> Views { get; }
Property Value
| Type | Description |
|---|---|
| List<WeakReference> |
Methods
View SourceGetHasUISettings(FrameworkElement)
Getter for the HasUISettings Dependency Property.
Declaration
public static bool GetHasUISettings(FrameworkElement element)
Parameters
| Type | Name | Description |
|---|---|---|
| FrameworkElement | element | The FrameworkElement. |
Returns
| Type | Description |
|---|---|
| bool |
HasUISettingsValue<T>(FrameworkElement)
Check whether the FrameworkElement element has settings for given T settings handler (behavior).
Declaration
public static bool HasUISettingsValue<T>(FrameworkElement element) where T : IUiElementSettings
Parameters
| Type | Name | Description |
|---|---|---|
| FrameworkElement | element | The FrameworkElement. |
Returns
| Type | Description |
|---|---|
| bool | True if the element has settings, otherwise False. |
Type Parameters
| Name | Description |
|---|---|
| T |
RestoreSettings(DependencyObject)
Restores the UI settings of the given DependencyObject.
Declaration
public static void RestoreSettings(DependencyObject uiParentElement)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | uiParentElement | A UI element. |
SetHasUISettings(FrameworkElement, bool)
Setter for the HasUISettings Dependency Property.
Declaration
public static void SetHasUISettings(FrameworkElement element, bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| FrameworkElement | element | The FrameworkElement. |
| bool | value | The value. |