右键拖动画布

This commit is contained in:
艾竹
2023-03-12 15:26:58 +08:00
parent fb7858fe74
commit e2753b0bff
16 changed files with 711 additions and 142 deletions

View File

@@ -18,15 +18,6 @@ namespace AIStudio.Wpf.DiagramDesigner
/// </summary>
public partial class TextControl : UserControl
{
//public static readonly DependencyProperty DoubleEditProperty = DependencyProperty.Register(
// nameof(DoubleEdit), typeof(bool), typeof(TextControl), new FrameworkPropertyMetadata(
// true));
//public bool DoubleEdit
//{
// get => (bool)GetValue(DoubleEditProperty);
// set => SetValue(DoubleEditProperty, value);
//}
public TextControl()
{
@@ -62,6 +53,7 @@ namespace AIStudio.Wpf.DiagramDesigner
if (this.DataContext is ISelectable selectable)
{
selectable.IsEditing = PART_ShowText.IsVisible;
PART_ShowText.Focusable = PART_ShowText.IsVisible;
}
}
@@ -89,39 +81,7 @@ namespace AIStudio.Wpf.DiagramDesigner
PART_ShowText.SelectionStart = PART_ShowText.Text.Length;
}
}
}
//protected override void OnPreviewMouseDown(MouseButtonEventArgs e)
//{
// base.OnPreviewMouseDown(e);
// if (DoubleEdit == false)
// {
// PART_ShowText.Visibility = Visibility.Visible;
// PART_TextBlock.Visibility = Visibility.Collapsed;
// PART_ShowText.Focus();
// if (!string.IsNullOrEmpty(PART_ShowText.Text))
// {
// PART_ShowText.SelectionStart = PART_ShowText.Text.Length;
// }
// }
//}
//protected override void OnPreviewMouseDoubleClick(MouseButtonEventArgs e)
//{
// base.OnPreviewMouseDoubleClick(e);
// if (DoubleEdit == true)
// {
// PART_ShowText.Visibility = Visibility.Visible;
// PART_TextBlock.Visibility = Visibility.Collapsed;
// PART_ShowText.Focus();
// if (!string.IsNullOrEmpty(PART_ShowText.Text))
// {
// PART_ShowText.SelectionStart = PART_ShowText.Text.Length;
// }
// }
//}
}
}
public class ControlAttachProperty