Is it possible to exectute MaximizeCommand for PaneToolWindow of XamDockManager in code behind?
Yes it is easy to do it in xaml. Something like this:
But I do need to run it in c#
Every command deriving from ICommand interface has an execute method, so it will look something like this:
var viewModel = (MyViewModel)DataContext;
As far as I am aware MaximizeCommand exists only for our Ribbon component, and there is no pre-build one, however you can check the dockmanager API, as the control itself has an exposed method ExecuteCommand.
Should you have any further questions, please let me know.
Sincerely, Tihomir Tonev Associate Software Developer Infragistics
Thank you for the replay.
But I'd like to execute the command not in a view model.
I'd like to execute the command for PaneToolWindow object like I can do it for ContentPane object.
For example this code activates content pane:
And I'd like to maximize a tool window in code behind the same way.
I have PaneToolWindow object and I'd like to execute ToolWindow.MaximizeCommand, but I don't have any idea how to do it.
Could you help me, please?
ToolWindow does have not only MaximizeCommand:
public static readonly RoutedCommand CloseCommand = new RoutedCommand("Close", typeof (ToolWindow)); /// <summary>Minimizes the containing window.</summary> public static readonly RoutedCommand MinimizeCommand = new RoutedCommand("Minimize", typeof (ToolWindow)); /// <summary>Maximizes the containing window.</summary> public static readonly RoutedCommand MaximizeCommand = new RoutedCommand("Maximize", typeof (ToolWindow)); /// <summary> /// Restores the containing window to the Normal <see cref="P:Infragistics.Windows.Controls.ToolWindow.WindowState" />. /// </summary> public static readonly RoutedCommand RestoreCommand = new RoutedCommand("Restore", typeof (ToolWindow));
It still happens the same way as in my previous reply. What you would call is:
In this instance, the window is the element you will maximize. In case you do not specify it, it will cast for the element that has keyboard focus on.
I have attached a sample that creates a new ToolWindow and maximizes during the ToolWindow loaded event. You can check it for further reference.
Should you have any other questions, please let me know.
Sincerely,Tihomir TonevAssociate Software DeveloperInfragistics
Thank you very much!!!
This is exactly what I need!
I am glad that you have found my suggestion helpfull.
Thank you for using Infragistics components.