mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-20 08:26:36 +08:00
思维导图修改成回车新增子节点
This commit is contained in:
@@ -18,6 +18,16 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
/// </summary>
|
||||
public partial class TextControl : UserControl
|
||||
{
|
||||
public static readonly DependencyProperty AcceptsReturnProperty = DependencyProperty.Register(
|
||||
nameof(AcceptsReturn), typeof(bool), typeof(TextControl), new FrameworkPropertyMetadata(
|
||||
true));
|
||||
|
||||
public bool AcceptsReturn
|
||||
{
|
||||
get => (bool)GetValue(AcceptsReturnProperty);
|
||||
set => SetValue(AcceptsReturnProperty, value);
|
||||
}
|
||||
|
||||
public TextControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -78,9 +88,11 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
BindingExpression binding = PART_ShowText.GetBindingExpression(TextBox.TextProperty);
|
||||
binding.UpdateSource();
|
||||
|
||||
PART_ShowText.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
|
||||
PART_ShowText.Visibility = Visibility.Collapsed;
|
||||
PART_TextBlock.Visibility = Visibility.Visible;
|
||||
|
||||
PART_TextBlock.Visibility = Visibility.Visible;
|
||||
|
||||
|
||||
selectable.IsEditing = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user