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?
After working on this and doing some research, "PaneToolWindow''s Minimize event" has been determined to be a new product idea. You can suggest new product ideas for future versions (or vote for existing ones) at http://ideas.infragistics.com.
There are many benefits to submitting an product idea:
- Direct communication with our product management team regarding your product idea.
- Notifications whenever new information regarding your idea becomes available.
- Ability to vote on your favorite product ideas to let us know which ones are the most important to you. You will have ten votes for this and can change which ideas you are voting for at any time.
- Allow you to shape the future of our products by requesting new controls and products altogether.
- You and other developers can discuss existing product ideas with members of our Product Management team.
Steps to create your idea:
The Product Idea site puts you in the driver’s seat and allows you to track the progress of your ideas at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.
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.
I can't understand the basic and most important moment here... When should UnpinnedTabFlyout_Loaded event handler work in your example? Even Visual Studio shows that this method is never used.
The Loaded event of UnpinnedTabFlyout element fires, when the ContentPane is "Auto Hide". If put a breakpoint and run the sample and set the Pane to be auto hided, you will notice that the event fires.
Thank you for reply. Now I understand that UnpinnedTabFlyout_Loaded fires for all content panes if I just set the appropriate style before the description of XamDockManager.
But I still have some difficulties in understanding how it works. I run your example, press Auto Hide, UnpinnedTabFlyout_Loaded fires, then MainWindow_IsVisibleChanged fires(e.OldValue = true, e.NewValue = false), then I put the cursor on the header, MainWindow_IsVisibleChanged fires again(e.OldValue = false, e.NewValue = true), then I press Auto Hide to switch off 'Auto Hide' mode, MainWindow_IsVisibleChanged fires again(e.OldValue = true, e.NewValue = false). Why do e.NewValue and e.OldValue have such values? As far as I understand, the window should be hidden, according to them.
When I repeat these actions one more time I have MainWindow_IsVisibleChanged fired for two times after pressing Auto Hide to switch on 'Auto Hide' mode(1.e.OldValue = false, e.NewValue = true, 2.e.OldValue = true, e.NewValue = false). Why?
And it works strange for my working project where I want to add this functionality.
<Grid Grid.Row="2" >
<Grid.Resources> <Style TargetType="{x:Type igDock:UnpinnedTabFlyout}"> <EventSetter Event="Loaded" Handler="UnpinnedTabFlyout_Loaded"/> </Style> </Grid.Resources>
<DockManager:XamDockManager x:Name="dockingManager" ActivePaneChanged="dockingManager_ActivePaneChanged" AllowMaximizeFloatingWindows="True" AllowMinimizeFloatingWindows="True" ToolWindowLoaded="dockingManager_ToolWindowLoaded" UseLayoutRounding="False"> <DockManager:XamDockManager.Panes> <DockManager:SplitPane x:Name="ToolBoxSplitPane" DockManager:XamDockManager.InitialLocation="DockedBottom" Height="200" > <DockManager:ContentPane AllowInDocumentHost="False" x:Name="ToolBoxContentPane" Header="{lex:LocText Key=trading, Dict=Strings, Assembly=StringsResources}" Visibility="{Binding ViewModel.ShowToolBox, Mode=TwoWay, Converter={StaticResource BoolToVisibilityConverter}}">
...
</DockManager:ContentPane> </DockManager:SplitPane>
</DockManager:XamDockManager.Panes>
</DockManager:XamDockManager></Grid>
I see that MainWindow_IsVisibleChanged fires several times for every action and UnpinnedTabFlyout_Loaded fires after several calls of MainWindow_IsVisibleChanged. e.NewValue and e.OldValue has values, that don't correspond to the current state of the window. And these all calls are for 'trading' ContentPane described above.
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.
Hope this helps you.