コード例 #1
0
        //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());
            }
        }
コード例 #2
0
        public void Navigate(UserControl view, object state)
        {
            Navigate(view);

            if (currentView != null)
            {
                currentView.UtilizeState(state);
            }
        }
コード例 #3
0
 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);
     }));
 }
コード例 #4
0
ファイル: PageSwitcher.xaml.cs プロジェクト: afrog33k/eAd
        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);
        }
コード例 #5
0
        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());
            }
        }
コード例 #6
0
        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!");
            }
        }
コード例 #7
0
        // 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());
            }
        }
コード例 #8
0
ファイル: MainWindow.xaml.cs プロジェクト: magseet/AttiLA
        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());
            }
        }