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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:13:27+00:00 2026-05-22T14:13:27+00:00

Where should I create constants for Label Text, Button Text etc in a WPF

  • 0

Where should I create constants for Label Text, Button Text etc in a WPF MVVM application?

Is the best practice to:-

Creating static properties in ViewModel

Creating an nested class in the Model class and exposing it through a property?

Any other way.

Please advise. I am new to MVVM.

  • 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-22T14:13:28+00:00Added an answer on May 22, 2026 at 2:13 pm

    Well I really liked and used this approach in my application. It uses standard Resx file for storing strings and uses Markup Extension for connecting view and the strings in resx file. You won’t have to do any dirty trick in View Model or Model. I think resx file is best place for storing constant strings which end user will see. I used this solution for also changing the language of application at runtime. Even if your requirements are simple and you don’t want fancy stuff you can use approach specified in post. It is really neat approach and places strings where they should be place (in resx). In next step you can directly bind text in resx with your label/button or anything you like.

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

Sidebar

Related Questions

Should I create private static final String = Some exception message or leave it
I'm trying to decide whether I should create a simple StackPanel with Buttons on
I'm wondering whether I should create extension methods that apply on the object level
I have this code which should create a splash image with either no animation
I'm learning MVC and am having trouble deciding when I should create a new
I have the following code, that in my head should create a new row
Should I create two CFile objects and copy one into the other character by
SHould I create a separate class for each object in an aggregate or should
Should I create a related view for each condition in my controller? e.g. I
Should one create unit tests involving IO? Ie, testing a class method for serializing/deserializing

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.