Hi, I'm trying to hide docking indicators when it is not possible to dock on a certain side. I started by copying the docking indicators as illustrated in the example "Customizing the DockIndicators" in the feature browser, so the code below closely resembles that. I already partly succeeded, but the center docking indicator is behaving strangely however. It is still showing the docking indicator untill at the moment the mouse enters the symbol, then it disappears. The following piece of code is not working as expected (I left out unimportant pieces):
<!-- Left Indicator --><igWindows:CardPanel x:Name="PART_DockLeft" ...> <Grid x:Name="leftIndicatorIcon" IsEnabled="{TemplateBinding CanDockLeft}" ...> <Ellipse x:Name="leftIndicatorBorder" ... /> <Viewbox ...> <Path x:Name="glyphLeft" ... /> </Viewbox> <Grid.Style> <Style TargetType="Grid"> <Style.Triggers> <DataTrigger Binding="{Binding Path=CanDockLeft, RelativeSource={RelativeSource Mode=TemplatedParent}}" Value="False"> <Setter Property="Visibility" Value="Collapsed"/> </DataTrigger> </Style.Triggers> </Style> </Grid.Style> </Grid></igWindows:CardPanel>
So basically I only added the style trigger. I also tried setting the Visibility property directly using a binding and a value converter, but that resulted in the same effect.
Hi
I’ve added some view models and converters to your sample.
First I added a view model for the AllowDocking right and left that is bound to a resource that can be used by all of the panes to indicate to which side they should be able to dock. That resource value is reversed when you click on the button.
And the AllowDocking right and left are also passed a value converter to compare the parameter to current docking side value and return true or false.
In the style, the Center Indicator’s visibility is bound to an additional property in the DockInds, instead of using your multiValueConverter TestConverter, I’m using a Boolean, CanDockInTabGroup, to control whether the Center Indicator is collapsed. This is similar conceptually to what we did for the right and left indicators.
You’ll notice that when you drag the orange colored form you see the Center Indicator and you can docked in a tab group but only on the content host. The other content panes can not be docked in a tab group and you do not see the center indicator.
Initially you only see the right indicator. If you click on the Change Docking Side button, you will update the resource and see the left indicator.
Please let me know if you have further questions.
If it is still not clear what I mean, you can take a look at the code that I added. It is based on the previous samples. I added a viewModel on which the system property is defined. This property is not yet being used however, because I'm not sure how to do it. It does illustrate what my intention is though.
By following these steps I hope that my intentions are more clear:
As a matter of fact I want to control both tabgroup and left/right docking. But it depends on the item you're dragging the dockable pane over. If you're dragging it over the main window (the documentcontenthost) it should be allowed to either tab the pane or to dock it on only one of the 2 sides. Which side is defined by the system parameter. But if you're dragging the pane over another pane that is already docked on that side, then tabbing is NOT allowed within that pane, and you can dock the pane on either the left or right side of that pane.
So, in any case, whether it is allowed to tab and/or to dock left / right depends on what you're dragging the pane over, it does not depend on the pane that is being dragged itself.
If I understand the AllowDockingInTabGroup property correctly, it specifies whether a certain pane can be added in a tabbed manner to another pane. So, specifying a AllowDockingInTabGroup=true is like saying "This pane can be tabbed anywhere". But what I want to achieve is to set, on a pane, whether other panes can be added to that pane in a tabbed manner. This is kind of the opposite.
The existing properties would be useful however, if I would be able to set them dynamically. One solution would be to set the AllowDockingInTabGroup (and the other 2 docking properties) on the pane that is being dragged on the moment the dragging enters another pane / documentcontenthost. Is there some kind of DragEnter event or something I can use?
It sounds as if you want to control when the contentpanes can be added to a tabgroup, which can be done with the AllowDockingInTabGroup property. Since you don’t seem to want to control the panes dock location remove the AllowDockingLeft and AllowDockingRight properties. Then add the AllowDockingIngInTabGroup set to False to each content pane.
You’ll be able to dock the panes to the right or left in the main window or add them as tabbed panes to the main window. But you will only be able to add them to the right or left side of the docked panes and won’t be able to add them as tabbed panes to the docked panes.
Let me know if this is what you had in mind.
Hello,
I'm afraid this solution is going in the wrong direction. What you are doing now is you're setting the docking possibilities per pane. This pane can dock left, that pane can dock right, etc. But that's not what I'm trying to achieve. What I want is: