Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Prevent diagram from nodes/links deletion (Read 2916 times)
rafaello
YaBB Newbies
*
Offline



Posts: 16
Joined: Jun 23rd, 2009
Prevent diagram from nodes/links deletion
Jul 8th, 2009 at 1:51pm
Print Post  
Hi,

I just thought that there could be diagram's property like "AllowDelete" which could prevent nodes/links from deletion.

Setting e.Cancel=true; in diagram's LinkDeleting/NodeDeleting events is ok, but i think the global flag for diagram items would be nice too  Cheesy

rafaello
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Prevent diagram from nodes/links deletion
Reply #1 - Jul 18th, 2009 at 12:00pm
Print Post  
Hi,

You could add a do-nothing binding for the Delete command:

diagram.CommandBindings.Add(new CommandBinding(
     ApplicationCommands.Delete, (x, e) => {}));

This should override the builtin binding to Delete.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint