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));