| | |
| | | using HMI.Base; |
| | | using HMI.Core.Api; |
| | | using Panuon.WPF.UI; |
| | | using Plugin.TestResult_WPF.Model; |
| | | using System.Collections.Generic; |
| | | using System.Collections.ObjectModel; |
| | | using System.ComponentModel; |
| | |
| | | } |
| | | |
| | | var content = data.Content; |
| | | var last = page.Child; |
| | | PluginPackage.Get(last)?.DeActive(); |
| | | var newPlugin = PluginPackage.Get(content); |
| | | var last = PluginPackage.Get(page.Child); |
| | | |
| | | if (last != null && !last.CanDeActive()) |
| | | { |
| | | SelectedSubMenu = (PluginInfo)e.RemovedItems[0]; |
| | | return; |
| | | } |
| | | |
| | | if (newPlugin != null && !newPlugin.CanActive()) |
| | | { |
| | | if (e.RemovedItems.Count > 0) |
| | | { |
| | | SelectedSubMenu = (PluginInfo)e.RemovedItems[0]; |
| | | } |
| | | return; |
| | | } |
| | | |
| | | last?.DeActive(); |
| | | newPlugin?.Active(); |
| | | if (data.Type == "WinForm") |
| | | { |
| | | if (content is System.Windows.Forms.Form form) |
| | |
| | | { |
| | | page.Child = (UIElement)content; |
| | | } |
| | | |
| | | PluginPackage.Get(content)?.Active(); |
| | | } |
| | | } |
| | | |