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
440
Startup position of XamDialogWindows
posted

I have this dialog. The position of the dialog will be depend on where i righ click the mouse (see the event trigger below

<ifc:XamDialogWindow x:Name="popMenu" WindowState="Hidden" IsModal="False" StartupPosition="Manual"  HeaderIconVisibility="Collapsed" MinimizeButtonVisibility="Collapsed" MaximizeButtonVisibility="Collapsed" Width="300">

    <StackPanel x:Name="pnMemu" Orientation="Vertical" HorizontalAlignment="Center"></StackPanel>

 </ifc:XamDialogWindow>

 

private void Border_MouseRightButtonDown(object sender, MouseButtonEventArgs e)

        {

            Point p = e.GetPosition(null);

            popMenu.ClearValue(;

            popMenu.StartupPosition = StartupPosition.Manual;

            popMenu.Top = p.Y - 200;

            popMenu.Left = p.X - 300;

            popMenu.Show();

            e.Handled = true;

        }

 

The first mouse click it will the dialog show as expected position. However from the second mouse from different postion the dialog still show up at the same as the first right click. Please help

  • 138253
    Offline posted

    Hello,

     

    It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking into your post and I created a sample project for you using the code you have provided and everything seems to work ok on my side. If the sample doesn’t satisfies all your needs feel free to modify it, so it reproduces your behavior and send it back to me for further investigation.

     

    Feel free to write me if you have further questions.

    SilverlightApplication1.zip