How do I pop up XamDialogWindow from XamRibbonWindow?
Thanks in advance.
HI,
You could wire up a button click event from your ribbon.
Here are some code snippets to show and hide the XamDialogWindow
private void ButtonTool_Click(object sender, RoutedEventArgs e)
{
xamDialogWindow1.Show(); //show the window
}
private void ButtonTool_Click_1(object sender, RoutedEventArgs e)
xamDialogWindow1.WindowState = Infragistics.Controls.Interactions.
WindowState.Hidden; //hide it
private void ButtonTool_Click_2(object sender, RoutedEventArgs e)
WindowState.Normal; //show it
Sincerely, Matt Developer Support Engineer
The problem lies with the need to add the XamDialogWindow as a child of the XamRibbonWindow.
Your code assumes it has been added somewhere in XAML. However, in order to add it on the fly, one needs to have e.g. a Grid as the content of the RibbonWindowContentHost. The correct code would look like:
private void ButtonTool_Click(object sender, RoutedEventArgs e) { var myDialogWindow = new Infragistics.Controls.Interactions.XamDialogWindow { Width = 200, Height = 200, IsModal = true, Content = "This is a sample dialog window", }; grid.Children.Add(myDialogWindow); myDialogWindow.Show(); }
But what if the content is a XamDockManager?