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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:45:58+00:00 2026-05-28T03:45:58+00:00

I’m wondering how to go about creating different views in the main window when

  • 0

I’m wondering how to go about creating different views in the main window when a button is pressed. I’m not sure of the correct terminology, so that has hampered my google fu.

I’m thinking that the main viewing area would be a content control, that I could change when a event happens. I made a small drawing to help illustrate my idea / thought.

Any input will be appreciated. Thanks!
Crude Mockup

  • 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-28T03:45:58+00:00Added an answer on May 28, 2026 at 3:45 am

    It would be really easy to implement this senario using MVVM approach….

    Make a ViewModel for you MainView. Then Define Properties of the ViewModels of your UserControls

    For Example You have Two UserControl as FirstView and SecondView then make a properties in your viewmodels as ViewToLoadProperty of the type ViewModel (usually called as ViewModelBase)

    Set bindings as

            <!--  Panel For Hosting UserControls  -->
            <Border Grid.Column="2">
                <ContentControl Name="userControlContentControl"
                                Content="{Binding Path=ViewToLoadProperty,
                                                  }">
                    <ContentControl.Resources>
                        <DataTemplate DataType="{x:Type ViewModelLayer:FirstViewModel}">
                            <ViewLayer:FirstView/>
                        </DataTemplate>
                        <DataTemplate DataType="{x:Type ViewModelLayer:SecondViewModel}">
                            <ViewLayer:SecondView />
                        </DataTemplate>
                                            </ContentControl.Resources>
                </ContentControl>
            </Border>
            <!--  Panel For Hosting UserControls  -->
    

    Then when you click the button Use a command to set the respective ViewModel Intance to this(ViewToLoadProperty) property…(Use RelayCommannds or something like it)

    DataTempates would do the rest of the job by selecting the right View according to the right type of ViewModel

    YOu can use MVVMLight toolkit if you are implementing MVVM Pattern.. 🙂

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm trying to create an if statement in PHP that prevents a single post
I'm working with an upstream system that sometimes sends me text destined for HTML/XML

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.