Class WindowSettingBehavior
Implements a setting behavior for System.Window.
Inheritance
Implements
Namespace: Sartorius.SAF.Presentation.Controls.Behaviors
Assembly: Sartorius.SAF.Presentation.Controls.dll
Syntax
public class WindowSettingBehavior : SettingBehavior<Window>, IAnimatable, IAttachedObject, IUIElementSettings
Remarks
Stores and restores the WindowState, Width, Height, Top and Left Property
Examples
This example illustrates how to use the WindowSettingBehavior to define a unique key for the window UI
<Window x:Class="Sartorius.SAF.Documentation.Examples.Behaviors.UISettingsBehaviors.WindowWithUiSettings"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:SAF="http://www.sartorius.com/SAF"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors">
<!-- set WindowSettingsBehvior with unique key for this window -->
<b:Interaction.Behaviors>
<SAF:WindowSettingBehavior SettingKey="WindowWithUiSettingsKey" />
</b:Interaction.Behaviors>
<!-- window content here -->
</Window>
This example shows how to define the contract name which is used to export/import the implementation of ISettingService used by ISettingsManager (and thus the SAF behavior to store UI settings)
Optional configuration in the application configuration file to control the location of the settings file in case of using the FileSettingService implementation the SAF provides for the ISettingService
Methods
View SourceOnAttached()
Attache to the event handler for LocationChanged and SizeChanged.
Declaration
protected override void OnAttached()
Overrides
OnDetaching()
Remove the event handler for LocationChanged and SizeChanged.
Declaration
protected override void OnDetaching()
Overrides
Restore(Object)
Restore a given settings.
Declaration
public override void Restore(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | A window settings. |
Overrides
Store()
Gets the control settings.
Declaration
public override object Store()
Returns
Type | Description |
---|---|
System.Object |