mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-12 20:49:26 +08:00
右键拖动画布
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user