#0011 拆分为子控件和Dock化

This commit is contained in:
zhengxuan.zhang
2026-03-14 16:55:35 +08:00
parent 62012db325
commit df5bfb14f3
21 changed files with 327 additions and 2191 deletions
+1 -4
View File
@@ -53,15 +53,12 @@ XplorePlane/
### XplorePlane.ImageProcessing (图像库) ### XplorePlane.ImageProcessing (图像库)
### TO-DO List ### TO-DO List
- [x] 软件基于 WPF + Prism 基础的框架 - [x] 软件基于 WPF + Prism 基础的框架
File diff suppressed because it is too large Load Diff
-40
View File
@@ -1,40 +0,0 @@
using System;
using System.Linq;
using System.Reflection;
using System.Windows;
using Telerik.Windows.Controls;
using Telerik.Windows.Documents.Spreadsheet.FormatProviders;
using Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx;
using Telerik.Windows.Documents.Spreadsheet.FormatProviders.Pdf;
using XplorePlane.ViewModels;
namespace XplorePlane
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : RadRibbonWindow
{
private readonly MainViewModel viewModel;
static MainWindow()
{
RadRibbonWindow.IsWindowsThemeEnabled = false;
}
public MainWindow()
{
InitializeComponent();
this.viewModel = new MainViewModel();
this.DataContext = this.viewModel;
this.Loaded += this.MainWindow_Loaded;
}
private void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
this.viewModel.OpenSampleCommand.Execute(null);
}
}
}
@@ -1,19 +0,0 @@
using Prism.Mvvm;
namespace XplorePlane.ViewModels
{
public class MainWindowViewModel : BindableBase
{
private string _title = "Prism Application";
public string Title
{
get { return _title; }
set { SetProperty(ref _title, value); }
}
public MainWindowViewModel()
{
}
}
}
+23
View File
@@ -0,0 +1,23 @@
<UserControl
x:Class="XplorePlane.Views.DetectorPanelView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="200"
d:DesignWidth="200"
mc:Ignorable="d">
<Grid Background="#FFFFFF">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border Grid.Row="0" Background="#F0F0F0" BorderBrush="#DDDDDD" BorderThickness="0,0,0,1">
<TextBlock Margin="8,4" HorizontalAlignment="Left" VerticalAlignment="Center"
FontWeight="SemiBold" Foreground="#333333" Text="探测器" />
</Border>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<StackPanel Margin="4" />
</ScrollViewer>
</Grid>
</UserControl>
@@ -0,0 +1,12 @@
using System.Windows.Controls;
namespace XplorePlane.Views
{
public partial class DetectorPanelView : UserControl
{
public DetectorPanelView()
{
InitializeComponent();
}
}
}
+21
View File
@@ -0,0 +1,21 @@
<UserControl
x:Class="XplorePlane.Views.ImagePanelView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="400"
d:DesignWidth="250"
mc:Ignorable="d">
<Grid Background="#FFFFFF">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border Grid.Row="0" Background="#F0F0F0" BorderBrush="#DDDDDD" BorderThickness="0,0,0,1">
<TextBlock Margin="8,4" HorizontalAlignment="Left" VerticalAlignment="Center"
FontWeight="SemiBold" Foreground="#333333" Text="图像" />
</Border>
<Grid Grid.Row="1" />
</Grid>
</UserControl>
+12
View File
@@ -0,0 +1,12 @@
using System.Windows.Controls;
namespace XplorePlane.Views
{
public partial class ImagePanelView : UserControl
{
public ImagePanelView()
{
InitializeComponent();
}
}
}
+67 -177
View File
@@ -7,6 +7,7 @@
xmlns:spreadsheet="clr-namespace:Telerik.Windows.Controls.Spreadsheet;assembly=Telerik.Windows.Controls.Spreadsheet" xmlns:spreadsheet="clr-namespace:Telerik.Windows.Controls.Spreadsheet;assembly=Telerik.Windows.Controls.Spreadsheet"
xmlns:spreadsheetControls="clr-namespace:Telerik.Windows.Controls.Spreadsheet.Controls;assembly=Telerik.Windows.Controls.Spreadsheet" xmlns:spreadsheetControls="clr-namespace:Telerik.Windows.Controls.Spreadsheet.Controls;assembly=Telerik.Windows.Controls.Spreadsheet"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:views="clr-namespace:XplorePlane.Views"
x:Name="ParentWindow" x:Name="ParentWindow"
Title="XplorePlane" Title="XplorePlane"
Width="1280" Width="1280"
@@ -1711,188 +1712,78 @@
</telerik:RadRibbonView.ContextualGroups> </telerik:RadRibbonView.ContextualGroups>
</telerik:RadRibbonView> </telerik:RadRibbonView>
<!-- Row 1: 主内容区 - 三栏布局 --> <!-- Row 1: 主内容区 - Dock 布局 -->
<Grid <telerik:RadDocking
x:Name="radDocking"
Grid.Row="1" Grid.Row="1"
Grid.RowSpan="2"
Grid.ColumnSpan="3" Grid.ColumnSpan="3"
Margin="0,0,0,24"> Margin="0,0,0,24"
<Grid.ColumnDefinitions> HasDocumentHost="True">
<ColumnDefinition Width="200" MinWidth="160" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="250" MinWidth="140" />
<ColumnDefinition Width="200" MinWidth="140" />
</Grid.ColumnDefinitions>
<!-- 左侧导航面板 --> <!-- 中间: 文档区域 -->
<Grid Grid.Column="0" Background="#FFFFFF"> <telerik:RadDocking.DocumentHost>
<Grid.RowDefinitions> <telerik:RadSplitContainer>
<RowDefinition Height="26" /> <telerik:RadPaneGroup>
<RowDefinition Height="*" /> <telerik:RadDocumentPane
</Grid.RowDefinitions> Header="2D Viewport"
CanUserClose="False"
Title="2D Viewport">
<views:ViewportPanelView />
</telerik:RadDocumentPane>
<telerik:RadDocumentPane
Header="图像"
Title="图像">
<views:ImagePanelView />
</telerik:RadDocumentPane>
</telerik:RadPaneGroup>
</telerik:RadSplitContainer>
</telerik:RadDocking.DocumentHost>
<Border <!-- 左侧: 计划导航 -->
Grid.Row="0" <telerik:RadSplitContainer InitialPosition="DockedLeft" Width="220">
Background="#F0F0F0" <telerik:RadPaneGroup>
BorderBrush="#DDDDDD" <telerik:RadPane
BorderThickness="0,0,0,1"> Header="计划"
<TextBlock CanUserClose="False"
Margin="8,0" CanFloat="False">
VerticalAlignment="Center" <views:NavigationPanelView />
FontWeight="SemiBold" </telerik:RadPane>
Foreground="#333333" </telerik:RadPaneGroup>
Text="计划" /> </telerik:RadSplitContainer>
</Border>
<TreeView <!-- 右侧: 属性面板 -->
Grid.Row="1" <telerik:RadSplitContainer InitialPosition="DockedRight" Width="220" Orientation="Vertical">
Background="Transparent" <telerik:RadPaneGroup>
BorderThickness="0" <telerik:RadPane
Foreground="#333333" Header="射线源"
ItemsSource="{Binding NavigationTree}" /> CanUserClose="False">
</Grid> <views:RaySourcePanelView />
</telerik:RadPane>
</telerik:RadPaneGroup>
<telerik:RadPaneGroup>
<telerik:RadPane
Header="运动控制"
CanUserClose="False">
<views:MotionControlPanelView />
</telerik:RadPane>
</telerik:RadPaneGroup>
<telerik:RadPaneGroup>
<telerik:RadPane
Header="探测器"
CanUserClose="False">
<views:DetectorPanelView />
</telerik:RadPane>
</telerik:RadPaneGroup>
<telerik:RadPaneGroup>
<telerik:RadPane
Header="导航"
CanUserClose="False">
<views:NavigationPropertyPanelView />
</telerik:RadPane>
</telerik:RadPaneGroup>
</telerik:RadSplitContainer>
<!-- 中间: 主视图区域 --> </telerik:RadDocking>
<Border
Grid.Column="1"
Background="#FFFFFF"
BorderBrush="#DDDDDD"
BorderThickness="1">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="18"
Foreground="#999999"
Text="2D Viewport" />
</Border>
<!-- 中间: 图像区域 -->
<Grid Grid.Column="2" Background="#FFFFFF">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Border
Grid.Row="0"
Background="#F0F0F0"
BorderBrush="#DDDDDD"
BorderThickness="0,0,0,1">
<TextBlock
Margin="8,4"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontWeight="SemiBold"
Foreground="#333333"
Text="图像" />
</Border>
</Grid>
<!-- 右侧属性面板 -->
<Grid Grid.Column="3" Background="#FFFFFF">
<Grid.RowDefinitions>
<RowDefinition Height="150" />
<RowDefinition Height="200" />
<RowDefinition Height="*" />
<RowDefinition Height="100" />
</Grid.RowDefinitions>
<!-- 射线源面板 -->
<Grid Grid.Row="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border
Grid.Row="0"
Background="#F0F0F0"
BorderBrush="#DDDDDD"
BorderThickness="0,0,0,1">
<TextBlock
Margin="8,4"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontWeight="SemiBold"
Foreground="#333333"
Text="射线源" />
</Border>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<StackPanel Margin="4" />
</ScrollViewer>
</Grid>
<!-- 运动控制面板 -->
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border
Grid.Row="0"
Background="#F0F0F0"
BorderBrush="#DDDDDD"
BorderThickness="0,0,0,1">
<TextBlock
Margin="8,4"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontWeight="SemiBold"
Foreground="#333333"
Text="运动控制" />
</Border>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<StackPanel Margin="4" />
</ScrollViewer>
</Grid>
<!-- 探测器面板 -->
<Grid Grid.Row="2">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border
Grid.Row="0"
Background="#F0F0F0"
BorderBrush="#DDDDDD"
BorderThickness="0,0,0,1">
<TextBlock
Margin="8,4"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontWeight="SemiBold"
Foreground="#333333"
Text="探测器" />
</Border>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<StackPanel Margin="4" />
</ScrollViewer>
</Grid>
<!-- 导航面板 -->
<Grid Grid.Row="3">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border
Grid.Row="0"
Background="#F0F0F0"
BorderBrush="#DDDDDD"
BorderThickness="0,0,0,1">
<TextBlock
Margin="8,4"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontWeight="SemiBold"
Foreground="#333333"
Text="导航" />
</Border>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<StackPanel Margin="4" />
</ScrollViewer>
</Grid>
</Grid>
</Grid>
<!-- Row 2: 状态栏 --> <!-- Row 2: 状态栏 -->
<Border <Border
@@ -1902,7 +1793,6 @@
BorderBrush="#DDDDDD" BorderBrush="#DDDDDD"
BorderThickness="0,1,0,0"> BorderThickness="0,1,0,0">
<Grid> <Grid>
<TextBlock <TextBlock
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Left" HorizontalAlignment="Left"
@@ -0,0 +1,23 @@
<UserControl
x:Class="XplorePlane.Views.MotionControlPanelView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="200"
d:DesignWidth="200"
mc:Ignorable="d">
<Grid Background="#FFFFFF">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border Grid.Row="0" Background="#F0F0F0" BorderBrush="#DDDDDD" BorderThickness="0,0,0,1">
<TextBlock Margin="8,4" HorizontalAlignment="Left" VerticalAlignment="Center"
FontWeight="SemiBold" Foreground="#333333" Text="运动控制" />
</Border>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<StackPanel Margin="4" />
</ScrollViewer>
</Grid>
</UserControl>
@@ -0,0 +1,12 @@
using System.Windows.Controls;
namespace XplorePlane.Views
{
public partial class MotionControlPanelView : UserControl
{
public MotionControlPanelView()
{
InitializeComponent();
}
}
}
@@ -0,0 +1,22 @@
<UserControl
x:Class="XplorePlane.Views.NavigationPanelView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="400"
d:DesignWidth="220"
mc:Ignorable="d">
<Grid Background="#FFFFFF">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border Grid.Row="0" Background="#F0F0F0" BorderBrush="#DDDDDD" BorderThickness="0,0,0,1">
<TextBlock Margin="8,4" HorizontalAlignment="Left" VerticalAlignment="Center"
FontWeight="SemiBold" Foreground="#333333" Text="计划" />
</Border>
<TreeView Grid.Row="1" Background="Transparent" BorderThickness="0"
Foreground="#333333" ItemsSource="{Binding NavigationTree}" />
</Grid>
</UserControl>
@@ -0,0 +1,12 @@
using System.Windows.Controls;
namespace XplorePlane.Views
{
public partial class NavigationPanelView : UserControl
{
public NavigationPanelView()
{
InitializeComponent();
}
}
}
@@ -0,0 +1,23 @@
<UserControl
x:Class="XplorePlane.Views.NavigationPropertyPanelView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="100"
d:DesignWidth="200"
mc:Ignorable="d">
<Grid Background="#FFFFFF">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border Grid.Row="0" Background="#F0F0F0" BorderBrush="#DDDDDD" BorderThickness="0,0,0,1">
<TextBlock Margin="8,4" HorizontalAlignment="Left" VerticalAlignment="Center"
FontWeight="SemiBold" Foreground="#333333" Text="导航" />
</Border>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<StackPanel Margin="4" />
</ScrollViewer>
</Grid>
</UserControl>
@@ -0,0 +1,12 @@
using System.Windows.Controls;
namespace XplorePlane.Views
{
public partial class NavigationPropertyPanelView : UserControl
{
public NavigationPropertyPanelView()
{
InitializeComponent();
}
}
}
+23
View File
@@ -0,0 +1,23 @@
<UserControl
x:Class="XplorePlane.Views.RaySourcePanelView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="150"
d:DesignWidth="200"
mc:Ignorable="d">
<Grid Background="#FFFFFF">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border Grid.Row="0" Background="#F0F0F0" BorderBrush="#DDDDDD" BorderThickness="0,0,0,1">
<TextBlock Margin="8,4" HorizontalAlignment="Left" VerticalAlignment="Center"
FontWeight="SemiBold" Foreground="#333333" Text="射线源" />
</Border>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<StackPanel Margin="4" />
</ScrollViewer>
</Grid>
</UserControl>
@@ -0,0 +1,12 @@
using System.Windows.Controls;
namespace XplorePlane.Views
{
public partial class RaySourcePanelView : UserControl
{
public RaySourcePanelView()
{
InitializeComponent();
}
}
}
+22
View File
@@ -0,0 +1,22 @@
<UserControl
x:Class="XplorePlane.Views.ViewportPanelView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="400"
d:DesignWidth="600"
mc:Ignorable="d">
<Grid Background="#FFFFFF">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border Grid.Row="0" Background="#F0F0F0" BorderBrush="#DDDDDD" BorderThickness="0,0,0,1">
<TextBlock Margin="8,4" HorizontalAlignment="Left" VerticalAlignment="Center"
FontWeight="SemiBold" Foreground="#333333" Text="2D Viewport" />
</Border>
<TextBlock Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center"
FontSize="18" Foreground="#999999" Text="2D Viewport" />
</Grid>
</UserControl>
@@ -0,0 +1,12 @@
using System.Windows.Controls;
namespace XplorePlane.Views
{
public partial class ViewportPanelView : UserControl
{
public ViewportPanelView()
{
InitializeComponent();
}
}
}
+3 -4
View File
@@ -7,10 +7,6 @@
<AssemblyName>XplorePlane</AssemblyName> <AssemblyName>XplorePlane</AssemblyName>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Compile Remove="MainWindow.xaml.cs" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<None Remove="XplorePlane.csproj.Backup.tmp" /> <None Remove="XplorePlane.csproj.Backup.tmp" />
</ItemGroup> </ItemGroup>
@@ -74,6 +70,9 @@
<Reference Include="Telerik.Windows.Controls.Input"> <Reference Include="Telerik.Windows.Controls.Input">
<HintPath>..\lib\RCWPF\2024.1.408.70.NoXaml\Telerik.Windows.Controls.Input.dll</HintPath> <HintPath>..\lib\RCWPF\2024.1.408.70.NoXaml\Telerik.Windows.Controls.Input.dll</HintPath>
</Reference> </Reference>
<Reference Include="Telerik.Windows.Controls.Docking">
<HintPath>..\lib\RCWPF\2024.1.408.70.NoXaml\Telerik.Windows.Controls.Docking.dll</HintPath>
</Reference>
<Reference Include="Telerik.Windows.Controls.Navigation"> <Reference Include="Telerik.Windows.Controls.Navigation">
<HintPath>..\lib\RCWPF\2024.1.408.70.NoXaml\Telerik.Windows.Controls.Navigation.dll</HintPath> <HintPath>..\lib\RCWPF\2024.1.408.70.NoXaml\Telerik.Windows.Controls.Navigation.dll</HintPath>
</Reference> </Reference>
+15
View File
@@ -0,0 +1,15 @@
---------------------------------------------------------------
__ __ _ _____ _
\ \ / / | | | __ \| |
\ V / _ __ | | ___ _ __ ___| |__) | | __ _ _ __ ___
> < | '_ \| |/ _ \| '__/ _ \ ___/| |/ _` | '_ \ / _ \
/ . \| |_) | | (_) | | | __/ | | | (_| | | | | __/
/_/ \_\ .__/|_|\___/|_| \___|_| |_|\__,_|_| |_|\___|
| |
|_|
---------------------------------------------------------------
2026.3.14
----------------------
1、主页面的布局与拆分,Dock 化 √