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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:24:06+00:00 2026-05-28T05:24:06+00:00

I have two user controls which needs to be loaded dynamically based on a

  • 0

I have two user controls which needs to be loaded dynamically based on a property in the database.

I am modifying an existing XAML page. The page contains the following line

 <wcontrols:page1  x:Name="page1" Width="674" Height="372.215"Canvas.Left="57" Canvas.  Top="215.785" Loaded="page1_Loaded_1" />

I want to switch between page1 with page2 dynamically. Should i need to move the code into the code-behind file or is there any way to do that within the XAML file?

  • 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-28T05:24:06+00:00Added an answer on May 28, 2026 at 5:24 am

    Define a style for the control and put in it a DataTrigger that set the page 2 at the change of a property of the viewmodel

    <ContentControl>
        <ContentControl.Style>
            <Style>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding Path=property}" Value="page1">
                        <Setter Property="ContentControl.Content" Value="{StaticResource page1}"/>
                    </DataTrigger>
                    <DataTrigger Biniding="{Binding Path=property}" Value="page2">
                        <Setter Property="ContentControl.Content" Value="{StaticResource page2}"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </ContentControl.Style>
    </ContentControl>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two controls which are both contained within a user control. Panel location:
I have an aspx page that dynamically loads user controls: there is an UpdatePanel
I have user control named DateTimeUC which has two textboxes on its markup: <asp:TextBox
I have a user control in a master page with two drop down lists.
I have a basic page to which I'm adding an uploader control based on
I have two web forms which are filled in by the user. They contain
I have a page where I use two ASP DetailsView controls to render data
I have two models -- User and Entry -- that are related through a
Let's say I have two objects: User and Race. class User attr_accessor :first_name attr_accessor
I have two processes - a user process and a root-level LaunchDaemon. I'd like

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.