Hi Team,
I am trying to load a xam dialog window but with respect to the parent window the alignment is not showing up proper.
} /// <summary> /// Opens the report data display graph container. /// </summary> /// <param name="mainWindow">The main window.</param> /// <param name="model">The telemetry workspace model</param> public void OpenGraphDisplayContainer(Window mainWindow, TelemetryWorkSpaceModel model) { //the pop up modal should cover the entire width of main window. model.GraphVisibility = Visibility.Visible; //set the properties of the modal popup. var reportContainerWindow = new XamDialogWindow { MinimizeButtonVisibility = Visibility.Collapsed, Width = mainWindow. ActualWidth-200, IsResizable = false, HorizontalContentAlignment = HorizontalAlignment.Center, VerticalContentAlignment = VerticalAlignment.Center, //make it .99 incase to avoid horzontal scroll bar from showing up in the main window. MaximizeButtonVisibility = Visibility.Collapsed, //StartupPosition = StartupPosition.Center, Content = new ContainerGraphDisplay(model.ListOfReportDistribution), CloseButtonVisibility = Visibility.Collapsed, HeaderIconVisibility = Visibility.Collapsed, IsModal = true, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment=HorizontalAlignment.Center,
StartupPosition = StartupPosition.Center };
//find the Grid that hosts the main grid and load the children in it. System.Windows.Controls.Grid gdParentWindow = mainWindow.FindName("GdParentWindow") as System.Windows.Controls.Grid; if (gdParentWindow != null) { //add the modal popup to the main parent grid as a child. gdParentWindow.Children.Add(reportContainerWindow); } }
Can u please let me know the mistake that the above code has.
Regards,
Sridhar
Hi,
I have attached a sample that demonstrates how to achieve that. If you have any other questions or this is not the desired behavior, let me know so that we can make the necessary adjustments.
Stefana