private void NavigateOnMenuClick(Action navigateAction, bool needClearStack = true) { if ((DateTime.Now - this._lastMenuNavigationDateTime).TotalMilliseconds < 700.0 || this._isNavigating) { return; } this._isNavigating = true; this._lastMenuNavigationDateTime = DateTime.Now; PageBase parentPage = this.ParentPage; parentPage.PrepareForMenuNavigation((Action)(() => { this._isNavigating = false; if (needClearStack) { WallPostVMCacheManager.ResetInstance(); } navigateAction(); if (needClearStack) { return; } Execute.ExecuteOnUIThread((Action)(async() => { await Task.Delay(1); this.HandleSamePageNavigation(parentPage, true); })); }), needClearStack); }
protected override void HandleOnNavigatedFrom(NavigationEventArgs e) { base.HandleOnNavigatedFrom(e); if (e.NavigationMode != NavigationMode.Back) { WallPostVMCacheManager.RegisterForDelayedSerialization(this._commentVM); } if (e.NavigationMode == NavigationMode.Back) { WallPostVMCacheManager.ResetInstance(); } this.SaveUnboundState(); }