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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:52:29+00:00 2026-06-01T08:52:29+00:00

I am new to WPF. I’m trying to build an application which has a

  • 0

I am new to WPF. I’m trying to build an application which has a function (call it Initialisation) where a user has to fill in a lot of data and some parts of the form are repeated. We’re rewriting a legacy app that has quite a long wizard in although we will probably use collapsible panels in one window rather than next/previous pages. Also some parts are repeated e.g. the user can specify a number of items, if they say 3 they will need to fill in some configuration info for each, so those controls would need to be repeated three times.

I’m using MVVM and am using this example here: http://msdn.microsoft.com/en-us/magazine/dd419663.aspx

The old wizard had about 4 pages so I’m intending to have one user control (Initialisation) that contains 4 child user controls to break the xaml up a bit.

So far I have the Initialisation (its ViewModel inherits from Workspace ViewModel as in the above example) and it contains one child which is working:

<Expander ExpandDirection="Down" Header="ChildOne">
<view:ChildOne />
</Expander>

I will have separate ViewModels for each child and for Intialisation and this brings me to my problem.
The problem I am having is that ChildOne contains a dropdown which I am trying to bind like so:

<ComboBox x:Name="textMessageTypeCmb" ItemsSource="{Binding Path=TextMessageSelectionOptions, Mode=OneTime}"/>

TextMessageSelectionOptions is a public property in ChildOne’s ViewModel. This results in no errors but an empty dropdown – that property getter is never called. If I move that property getter code into the Initialisation’s ViewModel instead it works but I’m trying to keep my code in manageable chunks so I’d like to put hat code back in ChildOne’s ViewModel. It also works if in my MainWindow I create ChildOne as a workspace instead of Initialisation like this

ChildOneViewModel ws = this.Workspaces.FirstOrDefault(vm => vm is ChildOneViewModel) as ChildOneViewModel;

Can anyone advise whether I am taking the right approach (by dividing it up into several user controls) and what I need to do in the binding to make this work? I don’t really understand any of this yet especially binding.

  • 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-01T08:52:30+00:00Added an answer on June 1, 2026 at 8:52 am

    It seems to me that your ChildOne view’s DataContext is still this Initialisation vm.

    You can bind it the views Datacontext to a ChildOneViewModel object

    ...
    <view:ChildOne DataContext={Binding PropertyReturnsChildOneViewModellObject/>
    ...
    

    or specify the path for the combobox ItemsSource prop.

    <ComboBox x:Name="textMessageTypeCmb" ItemsSource="{Binding Path=PropertyReturnsChildOneViewModellObject.TextMessageSelectionOptions, Mode=OneTime}"/>
    

    Note: PropertyReturnsChildOneViewModellObject is a property of the Initialisation vm.

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

Sidebar

Related Questions

I just created a new WPF application which has about 5 windows and makes
While designing a new WPF application I noticed exceptions not being thrown during data
I'm trying to integrate a new WPF control into an existing WinForms application and
I'm trying to get a legacy MFC application and a new WPF usercontrol to
I'm working on a new WPF application and I'm trying to stay as close
I am a new WPF user and I am trying to wrap my head
I'm VERY new to WPF, and still trying to wrap my head around binding
I'm new to WPF and data binding so hopefully I can explain the problem
I'm trying to extend my new WPF Touch Screen Keyboard (DLL) Library, to allow
I'm about to start on a new WPF application with a Sybase datastore. The

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.