Top "Datacontext" questions

A DataContext is used in WPF, Silverlight and various other .NET technologies.

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

I have a list (see below) contained in a window. The window's DataContext has two properties, Items and AllowItemCommand. How …

wpf data-binding datacontext
UserControl's DataContext

I'm creating a UserControl I want to use something like this: <controls:ColorWithText Color="Red" Text="Red color" /> …

wpf xaml datacontext
Enabling Service Broker in SQL Server 2008

I am integrating SqlCacheDependency to use in my LinqToSQL datacontext. I am using an extension class for Linq querys found …

asp.net linq caching datacontext sqlcachedependency
Silverlight - Setting DataContext in XAML rather than in constructor?

How can I set the DataContext on my Grid in XAML, instead of in the constructor? Here is how I …

silverlight datacontext
How to make Entity Framework Data Context Readonly

I need to expose an Entity Framework Data Context to 3rd party plugins. The purpose is to allow these plugins …

.net entity-framework entity-framework-4 datacontext readonly
How to instantiate DataContext object in XAML

I want to be able to create an instance of the DataContext object for my WPF StartupUri window in XAML, …

c# wpf xaml datacontext
How to use transactions with a datacontext

Can I use transactions with a datacontext, so that I can rollback the state of the context after an error? …

c# linq linq-to-sql transactions datacontext
Simulating Cross Context Joins--LINQ/C#

Here's the issue: I have 2 data contexts that I would like to do a join on. Now I know that …

c# entity-framework linq datacontext
WPF ContextMenu woes: How do I set the DataContext of the ContextMenu?

I am having some trouble figuring out how to set the correct DataContext on a ContextMenu. I have a collection …

wpf contextmenu datacontext
Setting <Window.DataContext> in XAML

I followed a very simple MVVM example as a basis for my program. The author had one code behind instruction …

c# wpf xaml mvvm datacontext