using BPA.UIControl.Commons;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
using static BPA.UIControl.DialogContainer;
namespace BPA.UIControl
{
///
/// 对话框操作类
///
public class Dialog
{
///
/// 对话框集合
///
internal static Dictionary Dialogs { get; private set; } = new Dictionary();
private static IDialogDataContextConfiguration dataContextConfiguration = new DialogDataContextConfiguration();
///
/// 配置对话框 DataContext 操作逻辑
///
/// 配置逻辑
public static void ConfigureDataContextAction(IDialogDataContextConfiguration configuration)
{
dataContextConfiguration = configuration;
}
///
/// 添加对话框
///
/// 标识
/// 对话框
internal static void AddDialogContainer(string identifier, DialogContainer dialog)
{
if (Dialogs.ContainsKey(identifier))
{
_ = Dialogs.Remove(identifier);
}
Dialogs.Add(identifier, dialog);
}
private static async Task