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 6233107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:14:18+00:00 2026-05-24T10:14:18+00:00

I am developing painting application in which i need to save my painting. To

  • 0

I am developing painting application in which i need to save my painting.
To save i need to show save file dialog , As i am implementing MVVM pattern i can’t directly use event handler.
But while implementing i thought of using PropertyChanged event directoly.

I have implemented INotifyPropertyChanged in ViewModel , I have bind all commands.
In save command in ViewModel i have called

    OnPropertyChanged("Show Save Dialog"); // in ViewModel

and in code behind of user control I have added event handler as

    ViewModel.PropertyChanged += new // in code behind of user control
          System.ComponentModel.PropertyChangedEventHandler(ViewModel_PropertyChanged);

and in ViewModel_PropertyChanged i have

   switch (e.PropertyName ) // in code behind of user control
        {
            case "Show Save Dialog": ShowSaveFileDialog();// this function shows dialog.
            break;
         }

This works fine in my situation but I don’t know the dark side of this implementation.

Is it right ????

  • 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-05-24T10:14:19+00:00Added an answer on May 24, 2026 at 10:14 am

    Right? There is no right or wrong, only the best choice at the current time. The only way for purists would be to abstract away the process of gaining such input from the user behind an interface, then create a View class which serves this interface and inject it somehow (IoC/DI, or perhaps by composition in the xaml if your ViewModels are instantiated that way).

    Personally, I wouldn’t spend too much time worrying about this, unless you must worry about this. I’ve done it both ways. For your average MVVM app, I think it is no great crime to just use a MessageBox, OpenFileDialog, etc. For heavily tested apps, you’ll need to abstract it away. And there are other situations that demand it as well. For example, I have code that exists in an application and in a Visual Studio extension. VS has its own dialog types which should be used instead of, say, MessageBox. So abstraction is appropriate. But I wouldn’t invest the work unless I had a reason to.

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

Sidebar

Related Questions

I'm developing an application in which I'm pasting images, doing drawing and painting on
'm developing an application in which I'm pasting images, doing drawing and painting on
Developing a C# .NET 2.0 WinForm Application. Need the application to close and restart
I'm developing a web application which processes invoices(the functionality is not limited to invoices,
i am developing an application where client can add his photos to appear on
I am developing an application in which I have to mark a set of
I am developing an intranet web application which works as a Suggestions Box. The
i am developing a application in wpf in which click event of the print,
I am currently developing an application in which I want to display a UserControl
I'm developing a PHP-based web-application in which you have a form with textarea inputs

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.