增强原材料入场记录视图模型,新增 SuspendEmbeddedPrintPreviewAirspace 属性以处理 WebView2 的嵌入式打印预览遮挡问题。重构相关对话框调用逻辑,确保在弹窗期间正确管理预览状态。同时,优化原材料卡片生成确认窗口的预览逻辑,提升用户体验和界面响应性。
This commit is contained in:
@@ -170,9 +170,18 @@ public class RawMaterialEntryOperationViewModel : RawMaterialEntryEditDialogView
|
||||
{
|
||||
if (!SetProperty(ref _isPrintPreviewExpanded, value)) return;
|
||||
if (value) _lastPreviewSnapshot = string.Empty;
|
||||
RaisePropertyChanged(nameof(IsPrintPreviewWebAreaVisible));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>右侧下方预览区是否显示 WebView2 宿主(HandyControl 内嵌弹窗期间因 Airspace 临时隐藏)。</summary>
|
||||
public bool IsPrintPreviewWebAreaVisible => !SuspendEmbeddedPrintPreviewAirspace && IsPrintPreviewExpanded;
|
||||
|
||||
protected override void OnSuspendEmbeddedPrintPreviewAirspaceChanged()
|
||||
{
|
||||
RaisePropertyChanged(nameof(IsPrintPreviewWebAreaVisible));
|
||||
}
|
||||
|
||||
private string _printPreviewStatus = string.Empty;
|
||||
/// <summary>预览区状态提示(如离线、加载中、错误摘要)。</summary>
|
||||
public string PrintPreviewStatus
|
||||
@@ -744,7 +753,9 @@ public class RawMaterialEntryOperationViewModel : RawMaterialEntryEditDialogView
|
||||
Owner = Application.Current.MainWindow,
|
||||
WindowStartupLocation = WindowStartupLocation.CenterOwner
|
||||
};
|
||||
var confirmed = confirmWindow.ShowDialog() == true;
|
||||
// WebView2 Airspace:模态子窗体仍可能与本窗体内 HWND 叠层异常,弹窗期间收起嵌入预览
|
||||
var confirmed = await SuspendEmbeddedPrintPreviewAirspaceWhileAsync(() =>
|
||||
Task.FromResult(confirmWindow.ShowDialog() == true));
|
||||
if (!confirmed) return;
|
||||
var selectedPrinterName = confirmWindow.SelectedPrinterName;
|
||||
if (string.IsNullOrWhiteSpace(selectedPrinterName))
|
||||
|
||||
Reference in New Issue
Block a user