Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8169843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:58:33+00:00 2026-06-06T20:58:33+00:00

In a WPF MVVM application, you have view models that contain all the logic

  • 0

In a WPF MVVM application, you have view models that contain all the logic behind the view, and views that display things. Doing things is linked through commands, which are implemented in the view model class.

When I want to open a new dialog window at the center of the initiating window, I need to set WindowStartupLocation = CenterOwner as well as Owner = something to the new dialog window. Unfortunately, the Owner property must be set to a view, but the view is never known in a view model.

So how is that supposed to work together?

Wild guess: Do I have to bind the view’s location and size to the view model and position the new dialog manually, not using the CenterOwner automatics?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T20:58:35+00:00Added an answer on June 6, 2026 at 8:58 pm

    but the view is never known in a view model.

    Ideally the ViewModel would be totally unaware of the View(s) that use it. But as you found out that is not always practical.

    It is therefore common to have a light coupling, for example as a View property in BaseViewModel.

    But your VM should not use any specific Controls or other details from the View.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in my MVVM application (in wpf) i have two view and I want to
I have an application which I am developing using WPF\Prism\MVVM. All is going well
I have a WPF application based on PRISM that utilizes the MVVM pattern. I
I have a WPF application implemented using the MVVM framework that uses an ActiveX
I have a MVVM application in WPF. I have an event that gets dispatched
I'm creating a WPF MVVM application. I have a long process that I want
I'm using MVVM in my WPF application. I have a Window that has a
I have a WPF application with MVVM, Entity Framework and a WCF service. I
I have a simple WPF application where I don't have any mvvm framework like
I'm building a WPF application and working with the MVVM pattern. I have 4

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.