void View_VisibilityChange(UIViewBase sender, UIViewVisibilityEventArgs args) { if (args.EventType == eViewEventType.DidShow) { OnShow(); } else if (args.EventType == eViewEventType.DidHide) { OnHide(); } else if (args.EventType == eViewEventType.WillShow) { try { WillShow(); } catch (Exception e) { ErrorLog.Exception(string.Format("Exception in UIViewController.WillShow(), {0}", e.Message), e); } } else if (args.EventType == eViewEventType.WillHide) { WillHide(); } }
void Owner_VisibilityChange(UIViewController sender, UIViewVisibilityEventArgs args) { if (args.EventType == eViewEventType.WillHide && View.Visible) { View.Hide(); } }
void ViewController_VisibilityChange(UIViewController sender, UIViewVisibilityEventArgs args) { if (sender.Visible && ViewTimeOut != null) { ViewTimeOut.Set(); } }
void Page_VisibilityChange(UIViewBase sender, UIViewVisibilityEventArgs args) { if (args.EventType == eViewEventType.WillShow) { var page = sender as UIPage; if (page != null) { foreach (var otherPage in page.OtherPages) { otherPage.Visible = false; } } } if (VisibilityChange != null) { VisibilityChange(sender, args); } }
void SubPage_VisibilityChange(UIViewBase sender, UIViewVisibilityEventArgs args) { #if DEBUG CrestronConsole.PrintLine("{0} SubPage Visibility Changed: {1}", this.GetType().ToString(), args.EventType.ToString()); #endif if (args.EventType == eViewEventType.WillShow) { this.Buttons.ButtonEvent += new UIButtonCollectionEventHandler(Buttons_ButtonEvent); } else if (args.EventType == eViewEventType.DidHide) { this.SubPage.VisibilityChange -= new UIViewBaseVisibitlityEventHandler(SubPage_VisibilityChange); this.Buttons.ButtonEvent -= new UIButtonCollectionEventHandler(Buttons_ButtonEvent); if (this.CallBack != null) { this.CallBack(this, action); } } }