Top "Datacontext" questions

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

Wpf datacontext binding using MVVM between viewmodel and view

I just started learning MVVM and here is what seems to be basic question but I spent whole day trying …

c# wpf mvvm data-binding datacontext
What is the advantage of setting DataContext in code instead of XAML?

There seem to be two main ways to define DataContext in WPF: either in code like this: App.xaml.cs (…

wpf xaml data-binding expression-blend datacontext
Entity Framework Thread Safety

The context objects generated by Entity Framework are not thread-safe. What if I use two separate entity contexts, one for …

c# concurrency entity-framework-4 thread-safety datacontext
Most efficient way to update with LINQ to SQL

Can I update my employee record as given in the function below or do I have to make a query …

c# asp.net linq linq-to-sql datacontext
Setting datacontext of UserControl to ViewModel defined in parent viewmodel

I'm trying to create an application using the MVVM pattern with nested viewmodels. The master viewmodel is ShellView which contains …

wpf xaml data-binding datacontext
How to access parent's DataContext from a UserControl

I need to access the container's DataContext from a UserControl (a grid containing textboxes and a listbox: I need to …

wpf user-controls datacontext
Setting Datacontext on contentpresenter: Binding inside ContentTemplate is not working

I'm learning WPF and the MVVM Pattern and I'm trying to build a calendar-like view. So I currently have a …

wpf xaml datacontext contentpresenter
UserControl as DataTemplate inside ListBox

I want to reuse my UserControls in other UserControls like page or window as DataTemplates, in this example inside a …

binding mvvm user-controls listbox datacontext
set xaml code ItemsSource="{Binding}" with code behind

I have the following property Temp2: (my UserControl implements INotifyPropertyChanged) ObservableCollection<Person> _Temp2; public ObservableCollection<Person> …

c# datacontext inotifypropertychanged itemssource
LINQPad, using multiple datacontexts

I am often comparing data in tables in different databases. These databases do not have the same schema. In TSQL, …

c# linq linq-to-sql datacontext linqpad