右键拖动画布

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

@@ -8,7 +8,6 @@
</ResourceDictionary.MergedDictionaries>
<Style x:Key="AIStudio.Styles.MindEditor" TargetType="{x:Type controls:MindEditor}">
<Setter Property="Focusable" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:MindEditor}">
@@ -20,10 +19,9 @@
<!-- ToolBox Control -->
<ContentControl x:Name="PART_ContentControl" Template="{Binding ToolBox,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>
<ScrollViewer Grid.Row="1">
<!-- Diagram Control -->
<dd:DiagramControl x:Name="PART_DiagramControl" MinWidth="1000" MinHeight="1000" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</ScrollViewer>
<!-- Diagram Control -->
<dd:DiagramControl Grid.Row="1" x:Name="PART_DiagramControl" MinWidth="1000" MinHeight="1000" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</Grid>
</ControlTemplate>
</Setter.Value>

View File

@@ -65,7 +65,7 @@ namespace AIStudio.Wpf.Mind.Controls
{
if (e.PropertyName == "IsSelected")
{
SelectedObject = _diagramViewModel.SelectedItems?.FirstOrDefault();
SelectedObject = _diagramViewModel.SelectedItem;
}
}
@@ -202,13 +202,5 @@ namespace AIStudio.Wpf.Mind.Controls
}
#endregion
protected override void OnPreviewKeyDown(KeyEventArgs e)
{
base.OnPreviewKeyDown(e);
e.Handled = _diagramViewModel.ExecuteShortcut(e);
}
}
}