Stories recently tagged with 'DataContext'

[WPF] How to bind to data when the DataContext is not inherited(tomlev2.wordpress.com)

submitted by tom103tom103(96) 10 months, 22 days ago

This post describes a solution for binding properties on elements that don't inherit the DataContext. This solution takes advantage of the Freezable class read more...

add a comment |category: |Views: 36

tags: another

This whimsical binding. TwoWay Binding to DataContext. Binding in WPF (rredcat.blogspot.com)

submitted by RredCatRredCat(299) 2 years, 7 months ago

I often use Binding to DataContext. It is one of the main advantage of WPF. In most case I set custom class inherit of DependencyObject (for support DependencyProperty) and I have some like next code: <StackPanel> <TextBlock Text="{Binding Path=Id}" /> <TextBlock Text="{Binding Path=Name}" /> <TextBlock Text="{Binding Path=Surname}"/> ... </StackPanel> But sometime I set a simple type for example string. For this case I can implement next Binding: <TextBlock Text="{Binding}" /> read more...

add a comment |category: |Views: 46

tags: another