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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:43:54+00:00 2026-05-24T02:43:54+00:00

I have a question regarding WPF UserControls and MVVM Pattern, I need to expose

  • 0

I have a question regarding WPF UserControls and MVVM Pattern, I need to expose a Property form my ViewModel so that it is visible in the Properties box (when the UserControl is placed on the MainWindow) so that the user of my WPF Control can set the value of the new property at design time.

This is easy when I put my custom Property get/set in the UserControl.xaml.cs file but this seems to violate MVVM rules.

Normally I can find the answer to most of the problems I come across but I am stumped now.

  • 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-24T02:43:55+00:00Added an answer on May 24, 2026 at 2:43 am

    You want to create a dependency property. Here’s a good guide:

    http://msdn.microsoft.com/en-us/library/ms752914.aspx

    Be sure to read through fully and understand that the get/set won’t be called for example with bindings – the internal property system will handle that. Hope that helps 🙂

    …

    Just noticed you’re talking about adding a property to the ViewModel – but then talk about a .xaml.cs file. Those are different things, the .xaml.cs is part of the View (XAML+code-behind) – it should bind to a ViewModel. Are you sure you have everything correct?

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

Sidebar

Related Questions

I have a question regarding how to best accomplish something in WPF MVVM. I
I am (very) new to WPF and I have got a question regarding that.
I have a question regarding the MVVM design for C#/WPF. I've had a look
I have a question regarding static function in php. let's assume that I have
I am new to WPF and have a question regarding dispatcher and Delegate.Invoke .
Greetings I have a question regarding the combobox in WPF, let me sketch the
I have a question regarding how to use the formula property to be used
I would have question regarding web services. Let's say I have webservice client that
Hi, I'm new to both Prism and WPF, and I have a question regarding
I have a question regarding some CSS that I'm sure has a simple solution,

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.