I have a PaneManager class that manages ContentPanes, and when a user opens a new pane and the active pane is in a SplitPane, the PaneManager morphs the SplitPane into a TabGroupPane. However, the transition is a bit disruptive, and I'm wondering if there is a smoother way to do it than the obvious:
else if (activePane.Parent is SplitPane)
{
var split = activePane.Parent as SplitPane;
split.Panes.Remove(activePane);
var group = new TabGroupPane();
split.Panes.Add(group);
group.Items.Add(activePane);
group.Items.Add(newPane);
}
Hi Darryl,
I have been looking into your question and we do not provide a built-in functionality that allows us to morph a SplitPane to TabGroupPane. I believe that removing/adding manually the panes is a good option. I am not sure whether this approach cause some kind of issue on your side. If yes, please attach a sample application where it appears in order to investigate it.
Looking forward to hearing from you.
We have looked at this scenario and we are not sure what exactly look disruptive for you.
When you activate a pane in a split pane there is a some flickering effect is that disturbs you thaw was caused by the pane activation? To be sure we are looking in the right place in your scenario can you show me a screenshot or video demonstrating this.
"Flickering" is perhaps a good way of describing what happens, as the SplitPane momentarily disappears before reappearing as a TabGroupPane. From that point forward everything is fine, since subsequent ContentPanes are added to the new TabGroupPane without flickering.
I was wondering if your developers had any insight as to how I might eliminate the initial flicker when I do the morph in code, since you can drag a pane onto a floating SplitPane (might be called a ToolWindow at that point) and the transition occurs smoothly (but there are a lot of other things happening in the UI, such as the shading and prompting for position, those things I don't need to incorporate).
The solution could be as simple as initially floating the single pane as a TabGroupPane in code, but if a user drags a pane to float it, it will be a SplitPane, and if I need to add another pane to THAT pane in code, I need the morph to occur.
I hope my question is clear. I don't think illustrations will add to what I haved described.
Hello Darryl,
I have created a sample application(DockManagerFlickering.zip) where I put the provided code in the ‘Click’ event body of a button in order to reproduce your issue and no flickering appears. Would you please modify my sample application or attach your own one in order to reproduce the described issue? Also, if possible, please attach a video that shows the issue.
I am glad that Andrew’s suggestion helps you to resolve your issue.
If you need any further assistance on this matter, do not hesitate to ask.
Well what is happening here is that when you remove the SplitPane from the floating pane there are no visible ContentPanes left within so the floating window is closed. Then when you add the pane back in it is being reshown. The better thing would be to add the new TabGroupPane and the item it will have within it and then move the original pane into that. e.g.
private void button1_Click(object sender, RoutedEventArgs e){ SplitPane split = pane1.Parent as SplitPane; TabGroupPane group = new TabGroupPane(); split.Panes.Add(group); ContentPane newPane = new ContentPane(); newPane.Header = "New Pane"; group.Items.Add(newPane); split.Panes.Remove(pane1); group.Items.Insert(0, pane1);}
Yanko,
Thanks for persisting with me on this one. Actually, your sample will flicker if you drag the ContentPane to float, then resize it substantially, as if it contained some content, and then click your button. I found the amount of flicker varied, so do this several times to see the variance. Then imagine a pane with content and styling.
With this approach, it really comes down to processor speed in re-painting the panes. If you think about it, some flicker is inevitable, as content is removed, and then added again. My question remains, is there another approach? Is there something XDM is doing, that can be shared, when a second ContentPane is dropped on a floating SplitPane?