Pre loader

ContextMenu binding to dependency property on UserControl and not to DataContext of UserControl.

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

Closed
0
0

Using a standard ContextMenu as defined with;

 <s:SciChartSurface.ContextMenu>
            <ContextMenu>
                 blablabla
           <ContextMenu>
</s:....>

How can I set the DataContext of this ContextMenu to a dependency property as defined on the usercontrol and not to the datacontext of the usercontrol (which is inherited from its parent). I tried setting an x:Name on the usercontrol and using {Binding property, ElementName=root} but it does not seem to work. Sorry if this is a general WPF question :-/

  • You must to post comments
0
0

After a drink, a fresh start and reading this. I simply set the datacontext of an inner control to innercontrol.DataContext = this. Solved everything;

(an essential) tutorial on usercontrols and databinding

  • You must to post comments
Showing 1 result

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies