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
195
XamDialogWindow in a Usercontrol as an Added UiElement display in Center of a Window
posted

Hello,

In my MainWindow I call OnInitialized a XamDialogWindow and add it to the UICollection of a grid:

XamDialogWindow _logon = new XamDialogWindow ();

this.DialogAddContainer.Children.Add(_logon);

My MainWindow has only, something like this:

<Window ...

 <Grid Name="DialogAddContainer">

<Grid >

// content

</Grid>

</Grid>

And my XamDialogwindow is in a UserControl:

<UserControl.....
<my:XamDialogWindow 
IsModal="True" 

So when my goal is to display the dialog window at startup Modal over the rest of my application 
and it should be have an alignment  the center of the window.
So I get this when setting my UserControl Horizontal and VerticalAlignment to center, then the 
XamDialogWindow  is displayed in the center of my Window but it is no longer Modal. 

How can I get the XamDialogWindow in a Usercontrol to the center of an window and keep it Modal of
my hole window?

regards