CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Mar 2004

    Unhappy WPF binding with viewmodel property

    I am trying to bind a commandparameter to a property of the viewmodel class for the view. the project is using MVVM.

    <Hyperlink Command="{Binding Path=AddJobAssignmentCommand}">Add Assignment
    <vm:AddJobAssignmentMultiConverter x:Key="AddJobAssignmentMultiConverter"/>
    <MultiBinding Converter="{StaticResource ResourceKey=AddJobAssignmentMultiConverter}">
    <Binding ElementName="lstTechnician" Path="SelectedValue"/>
    <Binding ElementName="chkPrimary" Path="IsChecked"/>
    <Binding ElementName="dtStartDate" Path="SelectedDate"/>
    <Binding Path="StartTime" />
    <Binding Path="EndTime" />

    The problem is with the last two parameters "StartTime" and "EndTime". Although both the properties are available in the viewmodel class and in Debug mode I can see that they have value, the parameters are always carrying null value. I have tried binding with a property which is present in the viewmodelbase class, from where this viewmodel is inherited. the parameter gets the value from that property, while I try with any property in the child viewmodel class, it gets null..

  2. #2
    Join Date
    Jan 2011

    Re: WPF binding with viewmodel property

    Can you post more code?

    If you can't post more, start a new project that you can post with the minimal code to duplicate the issue and post that code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.