About 443,000 results
Open links in new tab
  1. wpf - What is DataContext for? - Stack Overflow

    It makes sense if its DataContext is just aт isolated part of DataContext of its parent, doesn't it? And then I wouldn't bind the DataContext property of my user control, but would rather have a …

  2. wpf - UserControl's DataContext - Stack Overflow

    Feb 22, 2011 · DataContext is inherited to all lower Elements of the XAML and to all the XAML of UserControl s unless it is overwritten somewhere. By setting the UserControl DataContext to …

  3. c# - Setting DataContext in XAML in WPF - Stack Overflow

    May 17, 2014 · <Window.DataContext> <local:Employee/> </Window.DataContext> know that you are creating a new instance of the Employee class and assigning it as the data context …

  4. WPF Databinding: How do I access the "parent" data context?

    Nov 1, 2016 · The window's DataContext has two properties, Items and AllowItemCommand. How do I get the binding for the Hyperlink 's Command property needs to resolve against the …

  5. WPF ContextMenu woes: How do I set the DataContext of the …

    38 I am having some trouble figuring out how to set the correct DataContext on a ContextMenu. I have a collection of view models who are the source of an ItemsControl. Each view model has …

  6. Create DataContext from Entity Framework connection string?

    May 31, 2013 · The DataContext handles the mapping of your objects to the database differently than the Entity Framework; it relies on attributes on the models to map to tables/columns …

  7. c# - WPF Binding to parent DataContext - Stack Overflow

    Dec 8, 2014 · We have a WPF application with a standard MVVM pattern, leveraging Cinch (and therefore MefedMVVM) for View -> ViewModel resolution. This works well, and I can bind the …

  8. WPF binding multiple controls to different datacontexts

    Using the Binding Path you gain the flexibility to mix and match bindings to properties of different classes without concern for the DataContext of the controls' containers. You can also extend …

  9. Access parent DataContext from DataTemplate - Stack Overflow

    Aug 4, 2010 · I have a ListBox which binds to a child collection on a ViewModel. The listbox items are styled in a DataTemplate based on a property on the parent ViewModel: &lt;Style …

  10. What does DataContext="{Binding}" mean? - Stack Overflow

    Feb 27, 2015 · Without seeing more of your code it is hard to be certain, but DataContext="{Binding}" is quite often unnecessary, as any object in the current binding …