From ed490f4315db0dbc7aea0d7139273b6821681f26 Mon Sep 17 00:00:00 2001 From: lihanbo Date: Tue, 19 Nov 2024 12:11:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E9=A1=B9=E7=9B=AE=E7=BB=93?= =?UTF-8?q?=E6=9E=84=E5=B9=B6=E6=B7=BB=E5=8A=A0=E6=96=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将项目输出类型从 `Library` 更改为 `Exe`,并设置 `StartupObject` 为 `Sinvo.EplanHpD.Plugin.WPFUI.TestWindow`。删除了 `LectotypeWindow.xaml.cs` 的编译项,并添加了 `View\LectotypeWindow.xaml.cs`、`View\MainWindow.xaml.cs` 和 `View\CableLectotypeWindow.xaml.cs` 的编译项。添加了 `Utils\BaseAppExt.cs` 的编译项。 将 `MainWindow.xaml` 和 `TestWindow.xaml` 的页面项移动到 `View` 文件夹下,并添加了 `CableLectotypeWindow.xaml` 的页面项。在项目文件中添加了 `Common` 文件夹。在 `TestWindow.xaml.cs` 中添加了 `Main` 方法,并在其中显示 `CableLectotypeWindow`。 在 `Theme.xaml` 中添加了一个 `DataGrid` 的样式。添加了 `CableLectotypeWindow.xaml` 和 `CableLectotypeWindow.xaml.cs` 文件,定义了一个新的窗口。在 `LectotypeWindow.xaml` 中添加了一个按钮和 `DataGrid` 的上下文菜单,并在 `LectotypeWindow.xaml.cs` 中添加了多个事件处理方法。 在 `MainWindow.xaml.cs` 中修改了 `Dispatcher` 的调用方式。在 `DesignPluginEntry.cs` 中添加了 `EPLAN.Harness.AppCore` 的引用,并设置了窗口的所有者。在 `Sinvo.EplanHpD.Plugin.csproj` 中添加了 `EPLAN.Harness.AppCore` 的引用。 --- .../Sinvo.EplanHpD.Plugin.WPFUI.csproj | 40 +++-- .../TestWindow.xaml.cs | 10 ++ Sinvo.EplanHpD.Plugin.WPFUI/Themes/Theme.xaml | 3 + .../View/CableLectotypeWindow.xaml | 144 ++++++++++++++++++ .../View/CableLectotypeWindow.xaml.cs | 27 ++++ .../{ => View}/LectotypeWindow.xaml | 18 ++- .../{ => View}/LectotypeWindow.xaml.cs | 39 ++++- .../{ => View}/MainWindow.xaml | 1 - .../{ => View}/MainWindow.xaml.cs | 10 +- Sinvo.EplanHpD.Plugin/DesignPluginEntry.cs | 6 +- .../Sinvo.EplanHpD.Plugin.csproj | 4 + 11 files changed, 273 insertions(+), 29 deletions(-) create mode 100644 Sinvo.EplanHpD.Plugin.WPFUI/View/CableLectotypeWindow.xaml create mode 100644 Sinvo.EplanHpD.Plugin.WPFUI/View/CableLectotypeWindow.xaml.cs rename Sinvo.EplanHpD.Plugin.WPFUI/{ => View}/LectotypeWindow.xaml (97%) rename Sinvo.EplanHpD.Plugin.WPFUI/{ => View}/LectotypeWindow.xaml.cs (89%) rename Sinvo.EplanHpD.Plugin.WPFUI/{ => View}/MainWindow.xaml (99%) rename Sinvo.EplanHpD.Plugin.WPFUI/{ => View}/MainWindow.xaml.cs (98%) diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Sinvo.EplanHpD.Plugin.WPFUI.csproj b/Sinvo.EplanHpD.Plugin.WPFUI/Sinvo.EplanHpD.Plugin.WPFUI.csproj index f799f23..c5e6ac8 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/Sinvo.EplanHpD.Plugin.WPFUI.csproj +++ b/Sinvo.EplanHpD.Plugin.WPFUI/Sinvo.EplanHpD.Plugin.WPFUI.csproj @@ -5,7 +5,7 @@ Debug AnyCPU {2DBCD22A-650D-4797-9908-9C4D5D6665FE} - Library + Exe Sinvo.EplanHpD.Plugin.WPFUI Sinvo.EplanHpD.Plugin.WPFUI v4.8.1 @@ -56,7 +56,7 @@ true - + Sinvo.EplanHpD.Plugin.WPFUI.TestWindow true @@ -134,9 +134,6 @@ - - LectotypeWindow.xaml - @@ -154,6 +151,7 @@ TestWindow.xaml + @@ -170,17 +168,14 @@ - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - + + CableLectotypeWindow.xaml + + + LectotypeWindow.xaml + + MainWindow.xaml - Code Designer @@ -190,6 +185,18 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + @@ -239,5 +246,8 @@ 8.0.6 + + + \ No newline at end of file diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/TestWindow.xaml.cs b/Sinvo.EplanHpD.Plugin.WPFUI/TestWindow.xaml.cs index de4dfed..7e8c9a8 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/TestWindow.xaml.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/TestWindow.xaml.cs @@ -1,5 +1,7 @@ using EPLAN.Harness.ProjectCore; using EPLAN.Harness.ProjectCore.Occurrences.Designer; +using Sinvo.EplanHpD.Plugin.WPFUI.View; +using System; using System.Linq; using System.Windows; @@ -34,5 +36,13 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI testDataGrid.ItemsSource = wires; } + + [STAThread] + public static void Main() + { + var window = new CableLectotypeWindow(); + window.ShowDialog(); + + } } } diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Themes/Theme.xaml b/Sinvo.EplanHpD.Plugin.WPFUI/Themes/Theme.xaml index 23e0cf2..af59fc8 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/Themes/Theme.xaml +++ b/Sinvo.EplanHpD.Plugin.WPFUI/Themes/Theme.xaml @@ -3,4 +3,7 @@ + \ No newline at end of file diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/CableLectotypeWindow.xaml b/Sinvo.EplanHpD.Plugin.WPFUI/View/CableLectotypeWindow.xaml new file mode 100644 index 0000000..49a7c43 --- /dev/null +++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/CableLectotypeWindow.xaml @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/CableLectotypeWindow.xaml.cs b/Sinvo.EplanHpD.Plugin.WPFUI/View/CableLectotypeWindow.xaml.cs new file mode 100644 index 0000000..31dbe79 --- /dev/null +++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/CableLectotypeWindow.xaml.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace Sinvo.EplanHpD.Plugin.WPFUI.View +{ + /// + /// CableLectotypeWindow.xaml 的交互逻辑 + /// + public partial class CableLectotypeWindow : Window + { + public CableLectotypeWindow() + { + InitializeComponent(); + } + } +} diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/LectotypeWindow.xaml b/Sinvo.EplanHpD.Plugin.WPFUI/View/LectotypeWindow.xaml similarity index 97% rename from Sinvo.EplanHpD.Plugin.WPFUI/LectotypeWindow.xaml rename to Sinvo.EplanHpD.Plugin.WPFUI/View/LectotypeWindow.xaml index 50e244e..7db2f3c 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/LectotypeWindow.xaml +++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/LectotypeWindow.xaml @@ -15,6 +15,7 @@ d:DataContext="{d:DesignInstance Type=viewmodel:LectotypeViewModel}" Closed="Window_Closed" Loaded="Window_Loaded" + Topmost="False" WindowStartupLocation="CenterScreen" mc:Ignorable="d"> @@ -150,6 +151,12 @@ Click="ExportExcelBtn_Click" Content="导出下单表" Style="{StaticResource ButtonPrimary}" /> +