Hi i have following data structure.In here the property
ObservableCollection Items is part of the sturcture which will be binded to the DataGrid in the Node Data templated (refer the code and xaml below).While saving the Node data using the below code we want to save what ever the collection that Items property holds to the database (through service) and we want to retireve it back so that we can populate the datagrid while showing the node on the diagram.
************************************************************
var model = this.rcDiagram.Model as GraphLinksModel;
XElement root = model.Save("ND","LD",RuleConstant.LinkData);
***************************************
public class ItemEntity : BaseEntity {
string itemNumber; public string ItemNumber { get { return this.itemNumber; } set { this.itemNumber = value; this.RaisePropertyChanged("ItemNumber"); } }
string displayName; public string DisplayName { get { return this.displayName; } set { this.displayName = value; this.RaisePropertyChanged("DisplayName"); } }
string description; public string Description { get { return this.description; } set { this.description = value; this.RaisePropertyChanged("Description"); } } }
****************************************
using System.Windows.Shapes; using Northwoods.GoXam.Model; using Northwoods.GoXam; using System.Xml.Linq;using System.Collections.Generic; using System.Collections.ObjectModel;
namespace iCore.UI.Common.RuleData { public class ND : GraphLinksModelNodeData { private bool highlight = false;
public bool Highlight { get { return highlight; } set { bool old = highlight; if (old != value) { highlight = value; RaisePropertyChanged("Highlight", old, value); } } }
private double opacity = 1.00; public double Opacity { get { return opacity; } set { double old = opacity; if (old != value) { opacity = value; RaisePropertyChanged("Opacity", old, value); } } }
private string gID;
///
private NodeFigure _Figure = NodeFigure.Rectangle;
///
///
///
private ObservableCollection items = new ObservableCollection();
///
***************************XAML Code **************
************Xaml code*******************
<go:SpotPanel Background="{x:Null}" DataContext="{Binding}"
go:Node.Location="{Binding Path=Data.Location, Mode=TwoWay}"
Style="{StaticResource SpotPanelStyle}">
<Path x:Name="Shape" go:NodePanel.Figure="{Binding Path=Data.Figure}"
Stroke="{Binding Path=Data.Highlight, Converter={StaticResource theStrokeColorConverter}}"
StrokeThickness="{Binding Path=Data.Highlight, Converter={StaticResource theStrokeThicknessConverter}}"
Style="{StaticResource NodeShapeStyleAll}" />
<ListBox x:Name="listboxCgItems" Background="Silver" FontSize="10"
ItemsSource="{Binding Path=Data.Items}">
********************************
*
***************************************************