/// <summary> /// Activates the item on the given mindmap if its required /// </summary> /// <param name="mindmap">target mindmap</param> protected void ActivateItem(Mindmap mindmap) { // Don't activate the item when the users sets the activation attribute to false if (this.GetAttributeValue("activation") == "true") { mindmap.SetActiveItem(this.GetAttributeValue("name")); } }
public MindmapEditPageViewModel() { var n1 = new Node {Content = "hello", X = 50, Y = 50}; var n2 = new Node {Content = "akash", X = 100, Y = 50}; var c1 = new Connector(); c1.InvolvedRelationship = new NodeRelationship { Parent = n1, Child = n2, ChildAnchor = AnchorPoint.Left, ParentAnchor = AnchorPoint.Right, Connector = c1 }; n1.Relationships.Add(c1.InvolvedRelationship); n2.Relationships.Add(c1.InvolvedRelationship); var m = new Mindmap {MainNode = n1}; Mindmap = new MindmapViewModel(m); m.Elements.Add(n1); m.Elements.Add(n2); m.Elements.Add(c1); }
public override void ExecuteInstruction(Mindmap mindmap) { mindmap.SetActiveItem(this.GetAttributeValue("name")); }
public MindmapViewModel(Mindmap mindmap) : base(mindmap) { }
/// <summary> /// Create a new item in the north of the active item /// </summary> /// <param name="mindmap">target mindmap</param> public override void ExecuteInstruction(Mindmap mindmap) { AddMindMapItem(mindmap); CreateConnection(mindmap); ActivateItem(mindmap); }
private void EditTextCommand_Invoked(object sender, RoutedEventArgs e) { Mindmap.EditText(); }
/// <summary> /// Adds an item to the given mindmap. /// </summary> /// <param name="mindmap">target mindmap</param> protected void AddMindMapItem(Mindmap mindmap) { mindmap.AddItem(this.GetAttributeValue("name"), this.GetAttributeValue("caption"), this.GetAttributeValue("color")); }
/// <summary> /// Creates a connection /// </summary> /// <param name="mindmap"></param> private void CreateConnection(Mindmap mindmap) { mindmap.CreateConnection(this.GetAttributeValue("name"), Direction); }