Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
360
Xam Dialog Window Alignment with respect to parent window
posted

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