mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-29 12:43:24 +08:00
思维导图修改成回车新增子节点
This commit is contained in:
@@ -88,7 +88,11 @@
|
||||
<controls:PriorityControl Grid.Column="1" Priority="{Binding Priority}"
|
||||
Visibility="{Binding Priority,Converter={StaticResource NullableToVisibilityConverter}}"
|
||||
IsHitTestVisible="False"/>
|
||||
<dd:TextControl Grid.Column="2" IsHitTestVisible="{Binding IsEditing}"/>
|
||||
<dd:TextControl Grid.Column="2" IsHitTestVisible="{Binding IsEditing}" AcceptsReturn="False">
|
||||
<dd:TextControl.InputBindings>
|
||||
<KeyBinding Key="Enter" Command="{Binding ExitEditCommand}" />
|
||||
</dd:TextControl.InputBindings>
|
||||
</dd:TextControl>
|
||||
<controls:LinkControl Grid.Column="3"
|
||||
Visibility="{Binding LinkInfo,Converter={StaticResource NullableToVisibilityConverter}}"
|
||||
Url="{Binding LinkInfo.Link}"
|
||||
|
||||
@@ -456,7 +456,7 @@ namespace AIStudio.Wpf.Mind.ViewModels
|
||||
RaisePropertyChanged(nameof(MindType));
|
||||
RaisePropertyChanged(nameof(MindTheme));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -592,13 +592,19 @@ namespace AIStudio.Wpf.Mind.ViewModels
|
||||
foreach (var item in items)
|
||||
{
|
||||
if (item.ParentNode == null)
|
||||
continue;
|
||||
|
||||
int index = item.ParentNode.Children.IndexOf(item);
|
||||
var newitem = new MindNode(this) { Text = $"分支主题{item.ParentNode.Children.Count + 1}" };
|
||||
item.IsSelected = false;
|
||||
newitem.AddTo(item.ParentNode, index + 1);
|
||||
newitems.Add(newitem);
|
||||
{
|
||||
var newitem = new MindNode(this) { Text = $"分支主题{item.Children.Count + 1}" };
|
||||
newitem.AddTo(item);
|
||||
newitems.Add(newitem);
|
||||
}
|
||||
else
|
||||
{
|
||||
int index = item.ParentNode.Children.IndexOf(item);
|
||||
var newitem = new MindNode(this) { Text = $"分支主题{item.ParentNode.Children.Count + 1}" };
|
||||
item.IsSelected = false;
|
||||
newitem.AddTo(item.ParentNode, index + 1);
|
||||
newitems.Add(newitem);
|
||||
}
|
||||
}
|
||||
|
||||
items.Select(p => p.RootNode).Distinct().ToList().ForEach(p => p.UpdatedLayout());
|
||||
@@ -614,6 +620,11 @@ namespace AIStudio.Wpf.Mind.ViewModels
|
||||
});
|
||||
}
|
||||
|
||||
public override void ExecuteNextCommand(object parameter)
|
||||
{
|
||||
ExecuteAddPearCommand(parameter);
|
||||
}
|
||||
|
||||
private void ExecuteMoveBackCommand(object parameter)
|
||||
{
|
||||
List<MindNode> items = new List<MindNode>();
|
||||
@@ -1083,7 +1094,7 @@ namespace AIStudio.Wpf.Mind.ViewModels
|
||||
{
|
||||
roots = MindSelectedItems.Select(p => p.RootNode).Distinct().ToList();
|
||||
}
|
||||
|
||||
|
||||
if (roots.Count > 0)
|
||||
{
|
||||
DoCommandManager.DoNewCommand(this.ToString(),
|
||||
|
||||
@@ -746,7 +746,10 @@ namespace AIStudio.Wpf.Mind.ViewModels
|
||||
IsSelected = selected;
|
||||
}
|
||||
|
||||
|
||||
protected override void ExecuteExitEditCommand(object param)
|
||||
{
|
||||
Root.NextCommand.Execute(this);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user