public async void setContentViewReplaceCurrent(ViewModelInterface view, int amount) { topBar.hideAll(); if (topBarHidden) hideTopBar(1); if (contentViews.Count > 0) contentViews[contentViews.Count - 1].viewExitFocus(); //await Task.Delay(2); DependencyService.Get<ForceCloseKeyboard>().CloseKeyboard(); contentViews.RemoveRange(contentViews.Count - (1 + amount), amount); contentViews.Add(view); if(contentViews.Count > 1) topBar.showBackButton(true); //changeView(view); mainView.Content = view.getContentView(); view.viewInFocus(topBar); }
void changeView(ViewModelInterface view) { ContentView oldContentView = newContentView; newContentView = new ContentView() { Content = view.getContentView(), BackgroundColor = App.HowlOutBackground }; mainGrid.Children.Add(newContentView); //newContentView.TranslationX = this.Width; //await newContentView.TranslateTo(0, 0, 400, null); //view.viewInFocus(topBar); if(oldContentView != null) mainGrid.Children.Remove(oldContentView); oldContentView = null; }