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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:01:29+00:00 2026-06-09T22:01:29+00:00

The ViewModel class: class MyViewModel : ViewModelBase, INotifyPropertyChanged { public string SomeText { get{…}

  • 0

The ViewModel class:

class MyViewModel : ViewModelBase, INotifyPropertyChanged
{
    public string SomeText { get{...} set {...}}
    public AnyNonMVVMControl MyControl { get {...} set {...}}
    ...
}

The Window XAML:

<Grid>
...
<TextBlock Text="{Binding SomeText}" />
<??? Content="{Binding MyControl}" /> <!-- how to bind MyControl to the View? -->
...
</Grid>

Assign the Model

...
window.DataContext = new MyViewModel(...);
...

I have a Control, which isn´t designed for MVVM. Rendering and Data are strongly coupled (bad design solution). I have this control in my viewmodel and want to bind it to my window. But I don´t want to add the Control directly in the XAML, because this control contains also business logic and data -> I need to access it in the viewmodel for performing actions.

So, how to “add” the control via Bindings to the window?

  • 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-09T22:01:31+00:00Added an answer on June 9, 2026 at 10:01 pm

    Use ContentPresenter or ContentControl:

    <ContentControl Content="{Binding MyControl}" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a viewmodel. public class RegistrationViewModel { public RegisterModel Register { get; set;
Suppose I have ViewModel like public class AnotherViewModel { public string Name { get;
Say I have ViewModel class MyViewModel like: public class MyViewModel : ViewModelBase { private
I have the following ViewModel public class RecommendationModel { public List<CheckBoxItem> CheckBoxList { get;
What am I missing here? ViewModel: public class ViewModel { public IDictionary<int, string> Entities
I have a ViewModel defined like this: public class LocationTreeViewModel<TTree> : ObservableCollection<TTree>, INotifyPropertyChanged TTree
My ViewModel looks like this: public class DirectoryViewModel : ViewModelBase { public ObservableCollection<DirectoryViewModel> SubDirectoryList
I have a ViewModel like this: public class MyViewModel { [Display(Name = One_Name, ResourceType
If i have a ViewModel like this: public class MyViewModel { [UIHint(SomeTemplate)] public ICollection<SomeViewModel>
For example i have a viewmodel with something like this: public class MyViewModel {

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.