C# (CSharp) MegaMan.Editor.Controls AvalonDockLayoutSerializer - 2 exemples trouvés. Ce sont les exemples réels les mieux notés de MegaMan.Editor.Controls.AvalonDockLayoutSerializer extraits de projets open source. Vous pouvez noter les exemples pour nous aider à en améliorer la qualité.
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).