//Navigate and change state if something is not normal public void Navigate(UserControl nextPage, object state) { this.Content = nextPage; if (nextPage is Buildings_report) { this.Width = 1200; CenterWindowOnScreen(); } else { this.Width = 800; this.Height = 600; CenterWindowOnScreen(); } ISwitchable s = nextPage as ISwitchable; if (s != null) { s.UtilizeState(state); } else { throw new ArgumentException("NextPage is not ISwitchable! " + nextPage.Name.ToString()); } }
public void Navigate(UserControl view, object state) { Navigate(view); if (currentView != null) { currentView.UtilizeState(state); } }
public void Navigate(UserControl nextPage, object state) { Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() => { this.Content = nextPage; ISwitchable switchable1 = nextPage as ISwitchable; if (switchable1 == null) { throw new ArgumentException("NextPage is not ISwitchable! " + nextPage.Name.ToString(CultureInfo.InvariantCulture)); } switchable1.UtilizeState(state); })); }
public void Navigate(UserControl nextPage, object state) { base.Content = nextPage; ISwitchable switchable = nextPage as ISwitchable; if (switchable == null) { throw new ArgumentException("NextPage is not ISwitchable! " + nextPage.Name.ToString()); } switchable.UtilizeState(state); }
public void Navigate(UserControl nextPage, object State) { this.Content = nextPage; ISwitchable s = nextPage as ISwitchable; if (s != null) { s.UtilizeState(State); } else { throw new ArgumentException("NextPage is not ISwitchable! " + nextPage.Name.ToString()); } }
public void Navigate(UserControl newPage, object data, StateMessage msg) { this.Content = newPage; ISwitchable i = newPage as ISwitchable; if (i != null) { i.UtilizeState(data, msg); } else { throw new ArgumentException("NewPage is not Switchable!"); } }
// when loading views, with this apparently one can pass parameters to other views public void Navigate(UserControl nextPage, object state) { //load page this.Content = nextPage; // use ISwitchable interface ISwitchable s = nextPage as ISwitchable; // check if s is not null if (s != null) { s.UtilizeState(state); } else { throw new ArgumentException("NextPage is not ISwitchable! " + nextPage.Name.ToString()); } }
public void Navigate(UserControl nextPage, object state) { var prevPage = this.Content; if (prevPage is IDisposable) { (prevPage as IDisposable).Dispose(); } this.Content = nextPage; ISwitchable s = nextPage as ISwitchable; if (s != null) { s.UtilizeState(state); } else { throw new ArgumentException("NextPage is not ISwitchable! " + nextPage.Name.ToString()); } }