public bool OpenWindow(WindowName windowName) { UIMedia createCommand = GetCreateCommand(windowName.Key); if (createCommand != null) { GComponent component = createCommand.Inject(); if (component != null) { if (lastWindow != null && lastWindowContent != null && lastDispose != null) { if (lastDispose.Disposable) { lastWindowContent.Dispose(); } } if (lastWindow == null) { lastWindow = new Window(); lastWindow.name = "ModalWindow"; lastWindow.modal = true; } lastDispose = component as UIMdeiaDispose; lastWindowContent = component; lastWindow.AddChild(component); lastWindow.Show(); return(true); } } return(false); }
public bool CloseWindow(WindowName windowName, bool disposeChild = true) { if (disposeChild && lastWindowContent != null) { if (lastDispose.Disposable) { lastWindowContent.Dispose(); lastDispose = null; lastWindowContent = null; } } return(true); }