弹窗优化
This commit is contained in:
@@ -38,7 +38,7 @@ namespace UIShare.GlobalVariable
|
||||
/// 根据设备配置提取唯一的硬件指纹字符串。
|
||||
/// <para>Tcp → "Tcp:IP:Port";Serial → "Serial:PortName";无法识别则返回空字符串。</para>
|
||||
/// </summary>
|
||||
private static string ExtractHardwareFingerprint(DeviceInfoVM config)
|
||||
public static string ExtractHardwareFingerprint(DeviceInfoVM config)
|
||||
{
|
||||
if (string.Equals(config.ConnectionType, "Tcp", StringComparison.OrdinalIgnoreCase)
|
||||
&& config.TcpConfig != null)
|
||||
|
||||
@@ -10,6 +10,12 @@ namespace UIShare.UIViewModel
|
||||
/// <summary>Tab 标题(显示在标签页上)。</summary>
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 设备硬件指纹(如 "Tcp:192.168.1.100:502"),用于去重判断,
|
||||
/// 防止同一物理设备被重复打开多个 Tab。
|
||||
/// </summary>
|
||||
public string Fingerprint { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Tab 内容:传入一个已实例化的 <see cref="System.Windows.FrameworkElement"/>(通常是 UserControl),
|
||||
/// 由 ContentControl 直接承载展示。
|
||||
|
||||
@@ -21,6 +21,14 @@ namespace DeviceEditModule.ViewModels
|
||||
set => SetProperty(ref _title, value);
|
||||
}
|
||||
|
||||
private string _fingerprint = string.Empty;
|
||||
/// <summary>设备硬件指纹,用于去重字典的 Key。</summary>
|
||||
public string Fingerprint
|
||||
{
|
||||
get => _fingerprint;
|
||||
set => SetProperty(ref _fingerprint, value);
|
||||
}
|
||||
|
||||
private object? _content;
|
||||
/// <summary>Tab 内容区域(通常为 UserControl 实例)。</summary>
|
||||
public object? Content
|
||||
|
||||
Reference in New Issue
Block a user