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
Since you want to make the indicators collapse before anything has been dragged across the form, instead of using a trigger, binding the docking indicator’s Visibility property to the CanDockLeft or Right property of the template parent, I created a dockInds resource and used the ActivePaneChanged event to reset the values based on the currently active pane’s AllowDockingLeft and AllowDockingRight properties.
See the Left and Right Indicator on the SampWindow1 and the code behind in the ActivePaneChanged event.
I also added a FloatingWindowDragMode property to the xamDockManager set to Immediate.
Let me know if you have any questions.
Hey Marianne,
With "it is not possible to dock on a certain side" I mean that panes can either be docked left or right. It depends on a system setting which can be changed. I altered the code you provided so you can see what I mean.
Problem #1:When you start the sample application, you'll see the 3 panes floating. When you want to dock them and start dragging them when you'll notice both the left and right docking indicators are visible. If you drag the pane over the left indicator it will disappear. Is it possible to just hide it when you start dragging?
Problem #2:The 2nd problem occurs when all 3 panes are docked to the right side and you want to rearrange them. When you start dragging one of the panes and drag it over another, you'll notice the center icon is present. When you enter that area, you'll see that the icon disappears. Same question here!
Hi,
I'm not able to see any impact on the any of the docking indicator from the code snippet you provided.
Could you please provide an image of what you are seeing? It would also be helpful if you could explain when “it is not possible to dock on a certain side”.
I’m attaching my sample where I have two forms, one is directly taken from the feature browser, the other has docking indicators that are a little less elaborate compared to the feature browser sample and I’ve added color to each indicator so that they are more visible. I did incorporate the same DockingIndicator style into my sample form so we can work with either that seems most helpful.
As I understand what you provided, it looks like you applied the style trigger directly on the PART_DockLeft, which is an element of the centerIndicator controlTemplate. I believe what you will need to do is add style triggers to the DockingIndicator style.
It may be most helpful if you could modify my sample to illustrate what you have done.