Hello,
I need to change ContentPane's header when it's minimized. Is there any event for ContentPane's minimizing?
Thanks.
Hello Alexey,
Thank you for your post. I have been looking into it, but I am not sure that I fully understand your requirement, so could you please be more specific what do you mean by “ContentPane's minimizing”, because the pane cannot be minimized as a Window for example. It will be great if you send us screenshots of the two states, so we could be able to investigate this further for you.
Looking forward for your reply.
Thank you for reply, Stefan. You are right, as far as I understand, PaneToolWindow is really minimized, not ContentPane. I made the screenshot from Infragistics examples. How can I define that the window has just minimized?
Hello Stefan,
OK, I'll add a new product idea, if there is no appropriate event now. But I have one more similar problem. I press 'Auto Hide' button for the window in Dockable state and I change ContentPane's header by processing ExecutedCommand event for ContentPaneCommands.TogglePinnedState command, but I want to set the old header text when I put the cursor on the hidden window and it becomes shown. I haven't found any event I can process in such situation.
I mean, that if I have 'Window' caption for ContentPane and then I press 'Auto Hide' button, the caption for the hidden window will be 'Window <some text>'. When I put the cursor on the header of the hidden window to show it, the caption should become 'Window' again. So it should be 'Window' caption for the shown window and 'Window <some text>' for the hidden one.
P.S. By the way, I've tried to use OnSizeChanged event for ContentPane, because I've supposed it'll be generated on minimizing of PaneToolWindow. But OnSizeChanged is called only for the first time's minimizing and maximizing and isn't called later.
I have created a sample project with the functionality you want. Basically I created a Style for the UnpinnedTabFlyout element and add an EventSetter for its loaded event. In the handler I handle the IsVisibleChanged event, which fires when the ContentPane flies in or out. Please let me know if you need further assistance on this matter,.
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
Thank you for your reply. Unfortunately, I had no time to get this worked till this moment because of other tasks. But I can return to this suspended issue now. I'm still can't understand clearly the role of UnpinnedTabFlyout here. Can I just define IsVisibleChanged event handler to manage with this situation?
The UnpinnedTabFlyout is the element that contains the ContentPane and its visibility is changed. This is why I used it. The sample I shared with you is just a guideline, which you can use. If want to use another approach, please feel free to modify it, so it cover your requirements.
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>
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.
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.