Hello,
I need to change ContentPane's header when it's minimized. Is there any event for ContentPane's minimizing?
Thanks.
The issue you are describing is exactly the same that the control would have because the toolwindow can be shown when the mouse is over the panetabitem so if you're going to change the header to something shorter then the header wouldn't necessarily be visible any more. Perhaps what you need to do is have both headers present and then selectively show one and mark the other hidden (not collapsed) so that it still occupies the same extent it would if the longer header were still visible.
e.g. The following is a pane that shows the Header by default. When the pane is unpinned it will be as wide as the wider of the 2 texts and it will show the alternate text (stored in the Tag) when the content is not visible to the end user.
<igWpf:ContentPane Header="Header" Tag="Header (plus stuff)"> <igWpf:ContentPane.TabHeaderTemplate> <DataTemplate> <Grid> <TextBlock x:Name="short" Text="{Binding}" /> <TextBlock x:Name="long" TextAlignment="Center" Text="" Visibility="Collapsed" /> </Grid> <DataTemplate.Triggers> <Trigger Property="igWpf:XamDockManager.PaneLocation" Value="Unpinned"> <Setter TargetName="long" Property="Text" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type igWpf:PaneTabItem}}, Path=Pane.Tag}" /> <Setter TargetName="short" Property="TextAlignment" Value="Center" /> </Trigger> <!-- when the pane is unpinned and the content is visible then we want to make sure the alternate header is hidden so the tab can be wider if needed--> <MultiDataTrigger> <MultiDataTrigger.Conditions> <Condition Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type igWpf:PaneTabItem}}, Path=Pane.IsHitTestVisible}" Value="True" /> <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(igWpf:XamDockManager.PaneLocation)}" Value="Unpinned" /> </MultiDataTrigger.Conditions> <Setter TargetName="long" Property="Visibility" Value="Hidden" /> </MultiDataTrigger> <!-- when the pane is unpinned and the content is not visible then show the longer header (but make the other hidden in case it happens to be wider)--> <MultiDataTrigger> <MultiDataTrigger.Conditions> <Condition Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type igWpf:PaneTabItem}}, Path=Pane.IsHitTestVisible}" Value="False" /> <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=(igWpf:XamDockManager.PaneLocation)}" Value="Unpinned" /> </MultiDataTrigger.Conditions> <Setter TargetName="short" Property="Visibility" Value="Hidden" /> <Setter TargetName="long" Property="Visibility" Value="Visible" /> </MultiDataTrigger> </DataTemplate.Triggers> </DataTemplate> </igWpf:ContentPane.TabHeaderTemplate></igWpf:ContentPane>
Hello Stefan,
The idea was created: http://ideas.infragistics.com/forums/192363-wpf/suggestions/6600174-panetoolwindow-s-minimize-and-maximize-restore-ev . And I added the comment for it on Friday. It has 'Under review' status and I think it's worth to wait if it's implemented, because using events and flags make the issue too complicated.
Hello Alexey,
As I said before, there isn't an event which you can use and this is why I suggested you logging a product idea here:
http://ideas.infragistics.com/
The other thing you can do is use the events I suggested you and use boolean flags, because as you noticed the events fire more times than you need.
Hope this helps you.
I think it becomes too complicated. First of all, I want to remind what I want to do. I want to set ContentPane's header to 'header' when PaneToolWindow is shown and to 'header (additional info)' when it's hidden in 'Auto Hide' mode.
Using UnpinnedTabFlyout, MouseOver(or MouseEnter) and MouseLeave for PaneTabItem can't help me in implementation, because when MouseOver fires for the long header('header (additional info)'), it becomes the short header('header')(because PaneToolWindow is shown) and MouseLeave fires at once(the opposite situation is actual, when MouseLeave fires for the short header, it becomes the long header(because PaneToolWindow is hidden) and MouseOver fires at once). I can even see the infinite loop of MouseOver and MouseLeave events with infinite header's blinking.
I just need a sign that will definitely notify that PaneToolWindow is shown or hidden.
The behavior you described is expected, because the when you press the AutoHide button in order to pin the ContentPane the UnpinnedTabFlyout element is no longer visible. The same thing happens when you make the ContentPane AutoHidden. In order to achieve the functionality you want you will have to handle some of the cases and add "if" statements. You can also use the PaneTabItem element, which is the Tab, when the Pane is AutoHidden. You can handle its MouseOver or MouseLeftButtonDown events to help you achieve the functionality you want.