Inheritance: Windows.UI.Xaml.DependencyObject
Ejemplo n.º 1
0
		public StartPage()
		{
			this.InitializeComponent();
			this.navigationHelper = new NavigationHelper(this);
			this.navigationHelper.LoadState += navigationHelper_LoadState;
			this.navigationHelper.SaveState += navigationHelper_SaveState;

			if (_viewModel == null)
				_viewModel = DataContext as MainViewModel;


			// 메신저 연결.
			Messenger.Default.Register<GenericMessage<LbMessage>>(this, message =>
			{
				var frame = (Frame)Window.Current.Content;
				if (!(frame.Content is StartPage))
					return;
				switch (message.Content.MessageType)
				{
					case LbMessageType.EVT_SHOW_STARTING:
						{
							Debug.WriteLine("* StartPage Received Message: " + message.Content.MessageType.ToString());
							if (!(((Frame)Window.Current.Content).Content is ShowPage))
							{
								this.Frame.Navigate(typeof(ShowPage), message.Content.Data);
							}
						}
						break;
				}
			});
		}
Ejemplo n.º 2
0
        public ShowPage()
        {
            this.InitializeComponent();
            this.navigationHelper = new NavigationHelper(this);
            this.navigationHelper.LoadState += navigationHelper_LoadState;
            this.navigationHelper.SaveState += navigationHelper_SaveState;

            if (_vm == null)
                _vm = DataContext as MainViewModel;

            // 메신저 등록
            Messenger.Default.Register<GenericMessage<LbMessage>>(this, message =>
            {
                // Debug.WriteLine("* ShowPage.xaml.cs Received Message: " + message.Content.MessageType.ToString());
                switch (message.Content.MessageType)
                {
                    case LbMessageType.EVT_PAGE_READY:
                        loadFrame(_vm.CurrentPage.View);
                        break;
                    case LbMessageType.EVT_TICK:
                        // 팁을 보이고 있다면 판단하여 숨긴다.
                        if (GridTipBanner.Visibility == Visibility.Visible && !_vm.IsPreview && _counterForTipShowing > 0)
                        {
                            --_counterForTipShowing;
                            if (_counterForTipShowing <= 0)
                            {
                                _counterForTipShowing = 0;
                                GridTipBanner.Visibility = Visibility.Collapsed;
                            }
                        }
                        break;
                }
            });
        }
Ejemplo n.º 3
0
 public SampleBasicPage()
 {
     this.InitializeComponent();
     this.navigationHelper = new NavigationHelper(this);
     this.navigationHelper.LoadState += navigationHelper_LoadState;
     this.navigationHelper.SaveState += navigationHelper_SaveState;
 }
		public RecentOpenedPage()
		{
			this.InitializeComponent();

			if (_viewModel == null)
				_viewModel = DataContext as MainViewModel;

			// Setup the navigation helper
			this.navigationHelper = new NavigationHelper(this);
			this.navigationHelper.LoadState += navigationHelper_LoadState;
			this.navigationHelper.SaveState += navigationHelper_SaveState;

			// Setup the logical page navigation components that allow
			// the page to only show one pane at a time.
			this.navigationHelper.GoBackCommand = new RelayCommand(() => this.GoBack(), () => this.CanGoBack());
			this.itemListView.SelectionChanged += itemListView_SelectionChanged;

			// Start listening for Window size changes 
			// to change from showing two panes to showing a single pane
			Window.Current.SizeChanged += Window_SizeChanged;
			this.InvalidateVisualState();


			// 메신저 연결.
			Messenger.Default.Register<GenericMessage<LbMessage>>(this, message =>
			{
				var frame = (Frame)Window.Current.Content;
				if (!(frame.Content is RecentOpenedPage))
					return;
				switch (message.Content.MessageType)
				{
					case LbMessageType.EVT_SHOW_STARTING:
						{
							Debug.WriteLine("* RecentOpenedPage Received Message: " + message.Content.MessageType.ToString());
							if (!(((Frame)Window.Current.Content).Content is ShowPage))
							{
								this.Frame.Navigate(typeof(ShowPage), message.Content.Data);
							}
						}
						break;
					case LbMessageType.ERROR:
						{
							if (message.Content.Data is LbError && (LbError)message.Content.Data == LbError.NothingToPlay)
							{
								new MessageDialog(_loader.GetString("ErrorNothingToPlay")).ShowAsync();
							}
						}
						break;
					case LbMessageType.EVT_PAGE_STARTED:
						break;
				}
			});

		}