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

  • Home
  • SEARCH
  • 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 9174237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:43:12+00:00 2026-06-17T16:43:12+00:00

All, I am new to MVVM, so please be gentle. I have just learnt

  • 0

All, I am new to MVVM, so please be gentle. I have just learnt how to bind a basic ‘model’ or data to the view in WPF using MVVM. I am now embarking on a new application, and the first thing I would like to use MVVM for is to facilitate the quick change/development of new colour themes for the application. I am attempting to do this according to some basic tutorial I read online, but I have become confused over the best way to achieve what I want.

I have seen WPF and MVVM – changing themes dynamically but this does not help me; instead fuels more questions. What is the best way to do what I want? and how do I achieve it using MVVM?

If some one could provide a basic outline I would be very grateful.

  • 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-17T16:43:13+00:00Added an answer on June 17, 2026 at 4:43 pm

    Having MVVM doesn’t mean you’ll have no code behind. In fact, having solely UI related concerns in your ViewModel could be a code smell. Why not let the UI do its thing?

    public interface IMainView {
       void ChangeTheme(string themeName);
    }
    
    public class ViewModel {
    
       public IMainView View { get; } //get the view somehow
       public ICommand ChangeThemeCommand { get; }
    
       private void OnChangeThemeCommandExecute(string themeName) {
          View.ChangeTheme(themeName);
       }
    }
    

    With this approach you can test the invocation of the Command and delegation of that to the View (if that’s worth testing). You still have separation of concerns and some testability.

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

Sidebar

Related Questions

I'm new to Prism, but I have successfully built several WPF/Mvvm-Light applications. I'm using
Being a new to WPF/XAML/MVVM, I've got a question. In my View, I have
In a WPF MVVM application, you have view models that contain all the logic
I have an application all done in WPF, using MvvM/Prism/Unity and Remote as datasource.
In MVVM pattern, how to notify all properties of the view model has changed?
I'm kinda new to WPF. I'm making an app using WPF (all the UI
I'm currently introducing Prism to a new Wpf application, and am using the MVVM
I am developing an application in WPF using the MVVM pattern. If I have
In a MVVM WPF application, I have a master-detail View that is used to
I am using WPF and an MVVM pattern. All the comboboxes that are bound

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.