Hi,
I have following code, which should hide unknown elements when deserializing layout xml
Althought
I tried to set title of the paneView.Title as well. Title was not displayed.
Layout file look like this:
And another question, or request:
How can I prevent element from being serialized or deserialized? ElementLoading and ElementSaving should have cancelable EventArgs.
Thanks
I have following code, which should hide unknown elements when deserializing layout xml
private void dockManager_ElementLoaded(object sender, LayoutSerializationEventArgs e) { if (e.AffectedElement is RadPane) { RadPane paneView = e.AffectedElement as RadPane; ILayoutPane paneVM = viewModel.LayoutPanes .OfType<ILayoutPane>() .FirstOrDefault(vm => vm.Id == e.AffectedElementSerializationTag); if (paneVM == null) { paneView.IsHidden = true; } } }Althought
paneView.IsHidden = true is called, the pane is still visible after the LoadLayout.I tried to set title of the paneView.Title as well. Title was not displayed.
Layout file look like this:
<RadDocking> <DocumentHost> <RadSplitContainer> <Items> <RadPaneGroup SelectedIndex="0"> <Items> <RadPane IsHidden="False" IsDockable="True" /> </Items> </RadPaneGroup> </Items> </RadSplitContainer> </DocumentHost> </RadDocking>And another question, or request:
How can I prevent element from being serialized or deserialized? ElementLoading and ElementSaving should have cancelable EventArgs.
private void dockManager_ElementLoading(object sender, LayoutSerializationLoadingEventArgs e) { if (e.AffectedElementSerializationTag == null) e.Cancel = true; } Thanks