Create diagram from DB data instead of XML source

Hi everybody, thanks in advance for interest, help or other feedbacks.
How can use database table as source of data for diagram building?
I use LogicCirquit diagram from demo set as example.
Well, I get on display diagram from XML embedded file:

  <Gate Key="4" Location="300 110" GateType="OneInThreeOut" Figure="Cylinder1" />
  <Gate Key="2" Location="90 70" GateType="ThreeInOneOut" Figure="Cylinder1" />

I want to build diagram based on data from DB table like I posted below (It’s the same as XML)

Gate_Key Key_Name Loc_X Loc_Y Gate_Type Figure
Gate 4 300 110 OneInThreeOut Cylinder1
Gate 2 90 70 ThreeInOneOut Cylinder1

From LogicCircuit.xaml.cs I see that 2rows doing this with XML file:

    String xml = ImasWpf.MainWindow.Instance.LoadText("LogicCircuit", xml);
    model.Load<GateData, WireData>(XElement.Parse(xml), "Gate", "Wire");

How can I parse data from db dataset (or whatever else)?

Yes, that’s right – you do not have to use XML-formatted text as the communication mechanism. What database are you using and what ORM, if any?

Ideally the .NET objects that you get for each row will implement the INotifyPropertyChanged interface. If it doesn’t, that’s OK but more work on your part to explicitly update the model if the data changes dynamically.