private void OnScreenClosed(IScreenHost screenHost) { var handler = Closed; if (handler != null) { handler(this); } }
public bool RemoveScreen(IScreenHost screen) { if (screen.ScreenState != ScreenState.Active) { return(false); } screen.ExitScreen(); return(true); }
public void Show(bool isPopup) { _host = isPopup ? _createPopup(_view, _popupAttribute) : _createScreen(_view); if (_screen != null) { _host.Title = _screen.Title; } _host.ScreenClosed += OnScreenClosed; _isInPopup = isPopup; }
public void Show(bool isPopup) { host = isPopup ? createPopup(view, popupAttribute) : createScreen(view); if (screen != null) { host.Title = screen.Title; } host.ScreenClosed += OnScreenClosed; isInPopup = isPopup; }
public bool AddScreen(IScreenHost screen) { if (screen.ScreenState != ScreenState.Exit) { return(false); } screen.EnterScreen(); hosts.Add(screen); return(true); }
public TScreen CreateScreen() { var host = _createScreen(_view); if (_screen != null) { host.Title = _screen.Title; } host.ScreenClosed += OnScreenClosed; Host = host; _isPopup = false; return(host); }
public void Dispose() { _screen.PropertyChanged -= OnPropertyChanged; _host.ScreenClosed -= OnScreenClosed; _host = null; var disposable = _screen as IDisposable; if (disposable != null) { disposable.Dispose(); } }
public void Dispose() { screen.TitleChanged -= OnTitleChanged; host.ScreenClosed -= OnScreenClosed; host = null; var disposable = screen as IDisposable; if (disposable != null) { disposable.Dispose(); } }
public void Show(bool isPopup) { if (isPopup) { var host = _createPopup(_view, _popupAttribute); if (_screen != null) { host.Title = _screen.Title; } host.ScreenClosed += OnScreenClosed; Host = host; _isPopup = true; _showPopup(host); } else { var host = CreateScreen(); _showScreen(host); } }
protected Screen(IScreenHost host) { Host = host; }
private void DrawHost(IScreenHost host) { //spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); host.Draw(spriteBatch); //spriteBatch.End(); }
public LoginScreen(IScreenHost host) : base(host) { }
public CustomerScreen(IScreenHost host, Customer customer) : base(host) { Customer = customer; }
public static void SetHost(IScreenHost host) { _host = host; }
public bool IsShowing(IScreenHost screen) { return(hosts.Contains(screen)); }
private void OnScreenClosed(IScreenHost screenHost) => Closed?.Invoke(this);
public void AddHost(string hostTag, IScreenHost host) { hosts.Add(hostTag, () => host); }
public static void SetHost(IScreenHost host) { Host = host; }