Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
415
Proper way to set the datacontext of a ContentPane?
posted

I need to bind a property in my viewmodel to a property in a contentpane (IsEnabled for example).   The following doesnt work, as I get an error that SetIsEnabledInTheVM is not a dependency property:

<igDock:TabGroupPane>

  <igDock:ContentPane x:Name="contentPane">

      <ContentControl>

          <vm:MyViewModel SetIsEnabledInTheVM="{Binding ElementName=contentPane, Path=IsEnabled}" />

      </ContentControl>

  </igDock:ContentPane>

</igDock:TabGroupPane> 

After some reading up, I think this should work if the VM is set as the datacontext of the ContentPane (or ContentControl?).  But even if I do set the datacontext to my vm, I still dont see my view properly.  Where should I be setting the datacontext here, and how do I then access the SetIsEnabledInTheVM property?

Thanks!