WPF Reflections:

February, 2008

February 27, 2008  2:46 PM

Save ObservableCollection to Linq for Sql

Mark Shurmer Profile: MarkWPF

I described how you create an ObservableCollection from a Linq query (including Linq for Sql amongst others) in a previous post. A second part of the equation is of course, how do you...

February 26, 2008  8:25 PM

Creating an ObservableCollection from Linq for Sql

Mark Shurmer Profile: MarkWPF

Just how do you create an ObservableCollection from a Linq query? Not easily is the answer. If you are using WCF as part of your multi-tier strategy, then you can employ a trick that converts your generated Linq for Sql EntitySet classes into ObservableCollection classes. See a previous

February 25, 2008  12:06 AM

WPF validation via databinding

Mark Shurmer Profile: MarkWPF

February 24, 2008  10:11 PM

Databinding with Linq with automatic updates

Mark Shurmer Profile: MarkWPF

How do you databind to an EntitySet retreived from a Linq query, via Linq to Sql or Linq to Entities for example? Well it is very easy to actually bind to it, you simply connect it up using normal Xaml syntax. But what if you want to have updates automatically relected in the UI? That's...

February 19, 2008  4:08 PM

WPF databinding to Linq

Mark Shurmer Profile: MarkWPF

I think I have (at last) the workaround that gets WPF to bind to objects from Linq (to SQL or Entities or anything...) The problem is that Linq's EntitySet class doesn't implement INotifyCollectionChanged, so when you bind to an object that contains child collection classes you don't get...

February 18, 2008  1:20 PM

WPF incompatible with Linq for Sql

Mark Shurmer Profile: MarkWPF

Is WPF incompatible with Linq for Sql? Why do I suggest that? Well Linq for Sql has a method called GetNewBindingList() which copies an EntitySet<cls> (where cls is your entity type) to a BindingList<cls>. Unfortunately, the BindingList class is a Windows Forms binding class,...

February 17, 2008  10:54 AM

Combobox – reference not being set

Mark Shurmer Profile: MarkWPF

I've come across this strange little quoible. It's possibly just just the way I've been trying to use it, but it still seems odd to me If you have a ComboBox which you are databinding to using an object, like: <ComboBox SelectedItem="{Binding Path=Market}" /> Where Market is a...

February 8, 2008  4:24 PM


Mark Shurmer Profile: MarkWPF

I have been trying to get a three tier LOB system working over the past few weeks. As part of that , I did discover one cool thing about WCF with relation to WPF. That is, it's dead easy to specify which collection class you wish to use when the WCF classes are generated on the client. For...

February 8, 2008  3:42 PM

ListView – why does ItemTemplate not do anything

Mark Shurmer Profile: MarkWPF

Why does ItemTemplate not do anything? This is a question that I have asked myself this week, in between banging my head against the wall. What I wanted to do was apply a template to a row (in a GridView), in addition to the cell templates specified in the Columns attribute in the...

February 5, 2008  3:38 PM

ListView – rows with combo boxes

Mark Shurmer Profile: MarkWPF

Are you having a problem with a ListView with ComboBoxes? Do you have the scenario where you have a ListView with a GridView, and you have an editing template for one (or more) columns? Say your object looks like: public class Order {

public string Id { get ; set...

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: