Show / Hide Table of Contents

Class WindowSettingBehavior

Implements a setting behavior for System.Window.

Inheritance
object
DispatcherObject
DependencyObject
Freezable
Animatable
Behavior
Behavior<Window>
SettingBehavior<Window>
WindowSettingBehavior
Implements
IAnimatable
IAttachedObject
IUiElementSettings
SettingBehavior<Window>.SettingKey
SettingBehavior<Window>.SettingKeyProperty
Behavior<Window>.AssociatedObject
Behavior.CreateInstanceCore()
Behavior.Attach(DependencyObject)
Behavior.Detach()
Behavior.AssociatedType
Animatable.ApplyAnimationClock(DependencyProperty, AnimationClock)
Animatable.ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior)
Animatable.BeginAnimation(DependencyProperty, AnimationTimeline)
Animatable.BeginAnimation(DependencyProperty, AnimationTimeline, HandoffBehavior)
Animatable.Clone()
Animatable.FreezeCore(bool)
Animatable.GetAnimationBaseValue(DependencyProperty)
Animatable.HasAnimatedProperties
Freezable.CloneCore(Freezable)
Freezable.CloneCurrentValue()
Freezable.CloneCurrentValueCore(Freezable)
Freezable.CreateInstance()
Freezable.Freeze()
Freezable.Freeze(Freezable, bool)
Freezable.GetAsFrozen()
Freezable.GetAsFrozenCore(Freezable)
Freezable.GetCurrentValueAsFrozen()
Freezable.GetCurrentValueAsFrozenCore(Freezable)
Freezable.OnChanged()
Freezable.OnFreezablePropertyChanged(DependencyObject, DependencyObject)
Freezable.OnFreezablePropertyChanged(DependencyObject, DependencyObject, DependencyProperty)
Freezable.OnPropertyChanged(DependencyPropertyChangedEventArgs)
Freezable.ReadPreamble()
Freezable.WritePostscript()
Freezable.WritePreamble()
Freezable.CanFreeze
Freezable.IsFrozen
Freezable.Changed
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Equals(object)
DependencyObject.GetHashCode()
DependencyObject.GetLocalValueEnumerator()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.InvalidateProperty(DependencyProperty)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, object)
DependencyObject.SetValue(DependencyProperty, object)
DependencyObject.SetValue(DependencyPropertyKey, object)
DependencyObject.ShouldSerializeProperty(DependencyProperty)
DependencyObject.DependencyObjectType
DependencyObject.IsSealed
DispatcherObject.Dispatcher
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
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 Source

OnAttached()

Attache to the event handler for LocationChanged and SizeChanged.

Declaration
protected override void OnAttached()
Overrides
SettingBehavior<Window>.OnAttached()
View Source

OnDetaching()

Remove the event handler for LocationChanged and SizeChanged.

Declaration
protected override void OnDetaching()
Overrides
Microsoft.Xaml.Behaviors.Behavior.OnDetaching()
View Source

Restore(object)

Restore a given settings.

Declaration
public override void Restore(object value)
Parameters
Type Name Description
object value

A window settings.

Overrides
SettingBehavior<Window>.Restore(object)
View Source

Store()

Gets the control settings.

Declaration
public override object Store()
Returns
Type Description
object
Overrides
SettingBehavior<Window>.Store()

Implements

IAnimatable
Microsoft.Xaml.Behaviors.IAttachedObject
IUiElementSettings

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)
DependencyObjectExtensions.XamlClone<T>(T)
DependencyObjectExtensions.FindAncestor<T>(DependencyObject)
DependencyObjectExtensions.FindFirstChildByType<T>(DependencyObject)
DependencyObjectExtensions.FindLogicalAncestor<T>(DependencyObject)
DependencyObjectExtensions.GetChildrenByType<T>(DependencyObject)
DependencyObjectExtensions.GetContainer(DependencyObject)
DependencyObjectExtensions.SetContainer(DependencyObject, CompositionContainer)
  • View Source
Back to top Generated by DocFX