Hi
I'm trying to implement a diagram control using databinding. But I'm unable to use creating connections by click on one of the shape's port and drag it to another shape's port like the examples in the WPF demo. I've tried to set "IsConnectorManipulationEnabled" to true that doesn;t work either. I've attached my GraphSourceBase code below. Any suggestions to enable the default connector behaviour in databinding method ?
I'm trying to implement a diagram control using databinding. But I'm unable to use creating connections by click on one of the shape's port and drag it to another shape's port like the examples in the WPF demo. I've tried to set "IsConnectorManipulationEnabled" to true that doesn;t work either. I've attached my GraphSourceBase code below. Any suggestions to enable the default connector behaviour in databinding method ?
public class CMGraphSource : GraphSourceBase<
CMDeviceShapeViewModel
, ILink>
{
public CMGraphSource()
{
//Load initial objects into CMDiagram (Reciever and USBTripods)
int TripodCount = ConnectionHandler.Instance.getUSBTripodCount();
for (int i = 0; i < TripodCount; i++)
{
Tripod t = ConnectionHandler.Instance.getUSBTripod(i);
AddItem(new TripodCMViewModel(t.id));
}
int RecieverCount = ConnectionHandler.Instance.getRecieverCount();
for (int i = 0; i < RecieverCount; i++)
{
Reciever r = ConnectionHandler.Instance.getReciever(i);
AddItem(new RecieverCMViewModel(r.id));
}
ConnectionHandler.Instance.PropertyChanged += onConnectionHandlerDeviceChange;
}
private void onConnectionHandlerDeviceChange(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName.Equals("AddReciever", StringComparison.InvariantCultureIgnoreCase))
{
Reciever r = (Reciever)sender;
AddItem(new RecieverCMViewModel(r.id));
}
else if (e.PropertyName.Equals("RemoveReciever", StringComparison.InvariantCultureIgnoreCase))
{
Reciever r = (Reciever)sender;
}
else if (e.PropertyName.Equals("AddUSBTripod", StringComparison.InvariantCultureIgnoreCase))
{
Tripod t = (Tripod)sender;
AddItem(new TripodCMViewModel(t.id));
}
else if (e.PropertyName.Equals("RemoveUSBTripod", StringComparison.InvariantCultureIgnoreCase))
{
Tripod t = (Tripod)sender;
}
}
public void AddItem(CMDeviceShapeViewModel model)
{
if (base.InternalItems.Contains(model))
return;
base.AddNode(model);
}
}