C# Class MegaMan.Editor.Controls.AvalonDockLayoutSerializer

Class implements an attached behavior to load/save a layout for AvalonDock manager. This layout defines the position and shape of each document and tool window displayed in the application. Load/Save is triggered through command binding On application start (AvalonDock.Load event results in LoadLayoutCommand) and application shutdown (AvalonDock.Unload event results in SaveLayoutCommand). This implementation of layout save/load is MVVM compliant, robust, and simple to use. Just add the following code into your XAML: xmlns:AVBehav="clr-namespace:Edi.View.Behavior" ... avalonDock:DockingManager AnchorablesSource="{Binding Tools}" DocumentsSource="{Binding Files}" ActiveContent="{Binding ActiveDocument, Mode=TwoWay, Converter={StaticResource ActiveDocumentConverter}}" Grid.Row="3" SnapsToDevicePixels="True" AVBehav:AvalonDockLayoutSerializer.LoadLayoutCommand="{Binding LoadLayoutCommand}" AVBehav:AvalonDockLayoutSerializer.SaveLayoutCommand="{Binding SaveLayoutCommand}" The LoadLayoutCommand passes a reference of the AvalonDock Manager instance to load the XML layout. The SaveLayoutCommand passes a string of the XML Layout which can be persisted by the viewmodel/model. Both command bindings work with RoutedCommands or delegate commands (RelayCommand).
Afficher le fichier Open project: Tesserex/C--MegaMan-Engine Class Usage Examples

Méthodes publiques

Méthode Description
GetLoadLayoutCommand ( DependencyObject obj ) : ICommand

Standard get method of LoadLayoutCommandProperty dependency property.

GetSaveLayoutCommand ( DependencyObject obj ) : ICommand

Standard get method of SaveLayoutCommandProperty dependency property.

SetLoadLayoutCommand ( DependencyObject obj, ICommand value ) : void

Standard set method of LoadLayoutCommandProperty dependency property.

SetSaveLayoutCommand ( DependencyObject obj, ICommand value ) : void

Standard get method of SaveLayoutCommandProperty dependency property.

Private Methods

Méthode Description
OnFrameworkElement_Loaded ( object sender, RoutedEventArgs e ) : void

This method is executed when a AvalonDock DockingManager instance fires the Load standard (FrameworkElement) event.

OnFrameworkElement_Saveed ( object sender, RoutedEventArgs e ) : void

This method is executed when a AvalonDock DockingManager instance fires the Unload standard (FrameworkElement) event.

OnLoadLayoutCommandChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

This method is executed if a LoadLayoutCommandProperty dependency property is about to change its value (eg: The framewark assigns bindings).

OnSaveLayoutCommandChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

This method is executed if a SaveLayoutCommandProperty dependency property is about to change its value (eg: The framewark assigns bindings).

Method Details

GetLoadLayoutCommand() public static méthode

Standard get method of LoadLayoutCommandProperty dependency property.
public static GetLoadLayoutCommand ( DependencyObject obj ) : ICommand
obj System.Windows.DependencyObject
Résultat ICommand

GetSaveLayoutCommand() public static méthode

Standard get method of SaveLayoutCommandProperty dependency property.
public static GetSaveLayoutCommand ( DependencyObject obj ) : ICommand
obj System.Windows.DependencyObject
Résultat ICommand

SetLoadLayoutCommand() public static méthode

Standard set method of LoadLayoutCommandProperty dependency property.
public static SetLoadLayoutCommand ( DependencyObject obj, ICommand value ) : void
obj System.Windows.DependencyObject
value ICommand
Résultat void

SetSaveLayoutCommand() public static méthode

Standard get method of SaveLayoutCommandProperty dependency property.
public static SetSaveLayoutCommand ( DependencyObject obj, ICommand value ) : void
obj System.Windows.DependencyObject
value ICommand
Résultat void