Cannot centre window, even when parent is set

2 posts, 0 answers
  1. David
    David avatar
    19 posts
    Member since:
    Jun 2008

    Posted 22 Aug 2010 Link to this post

    I am unable to centre a child dialog window of type RadWindow. I create the window as following:

    NewGoalWindow view = new NewGoalWindow();
    view.WindowStartupLocation = WindowStartupLocation.CenterOwner;
    view.Owner = WindowHelper.MainWindow;
    NewGoalViewModel model = new NewGoalViewModel();
    model.RequestClose += delegate
    {
      view.Close();
    };
    view.DataContext = model;
    view.ShowDialog();

    The window is always located in the top left corder. WindowHelper.MainWindow is a reference to a RadWindow, which I have checked is the main window of the application.

    I need help. Am I overlooking something?
  2. David
    David avatar
    19 posts
    Member since:
    Jun 2008

    Posted 25 Aug 2010 Link to this post

    This has been resolved. I think there was a theme that I had applied that messed up the positioning of windows.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top