protected override void OnUnloaded() { base.OnUnloaded(); DataContext = null; entityVMStack.Clear(); windowInputContext?.Stop(); windowInputContext = null; if (Instance == this) { Instance = null; } }
public static void Open(ProtoEntityViewModel entityViewModel) { if (Instance == null) { var instance = new DetailsWindow(); instance.entityVMStack.Push(entityViewModel); Instance = instance; Api.Client.UI.LayoutRootChildren.Add(instance); } else { if (Instance.entityVMStack.Peek() != entityViewModel) { Instance.entityVMStack.Push(entityViewModel); Instance.UpdateCount(); Instance.DataContext = Instance.entityVMStack.Peek(); } } }