Пример #1
0
        Page PageForOption(MenuItem option)
        {
            if (option is AboutMenuItem)
            {
                return(new AboutPage());
            }
            if (option is VectorSpeechBubbleMenuItem)
            {
                return(new VectorSpeechBubblePage());
            }
            if (option is CappedImageMenuItem)
            {
                return(new CappedImagePage());
            }
            if (option is RoundedFrameMenuItem)
            {
                return(new RoundedFramePage());
            }
            if (option is ChatSampleMenuItem)
            {
                return(new ChatPage());
            }

            throw new NotImplementedException("Unknown menu option: " + option.Title);
        }
Пример #2
0
		Page PageForOption (MenuItem option)
		{
			if (option is AboutMenuItem)
				return new AboutPage ();
			if (option is VectorSpeechBubbleMenuItem)
				return new VectorSpeechBubblePage ();
			if (option is CappedImageMenuItem)
				return new CappedImagePage ();
			if (option is RoundedFrameMenuItem)
				return new RoundedFramePage ();
			if (option is ChatSampleMenuItem)
				return new ChatPage ();

			throw new NotImplementedException("Unknown menu option: " + option.Title);
		}
Пример #3
0
		/// <summary>
		/// Navigate to the view for the specified menu option
		/// </summary>
		public void NavigateTo(DNA.XForms.Sample.ViewModels.MenuItem option) {
			if (previousItem != null)
				previousItem.Selected = false;

			option.Selected = true;
			previousItem = option;

			var displayPage = PageForOption(option);

			Device.OnPlatform (WinPhone: () => Detail = new ContentPage ());  //work around to clear current page.

			Detail = new NavigationPage(displayPage)
			{
				BarBackgroundColor = ColorHelper.ToolbarBackground,
				BarTextColor = Color.White,
			};

			IsPresented = false;
		}
Пример #4
0
        /// <summary>
        /// Navigate to the view for the specified menu option
        /// </summary>
        public void NavigateTo(DNA.XForms.Sample.ViewModels.MenuItem option)
        {
            if (previousItem != null)
            {
                previousItem.Selected = false;
            }

            option.Selected = true;
            previousItem    = option;

            var displayPage = PageForOption(option);

            Device.OnPlatform(WinPhone: () => Detail = new ContentPage());                //work around to clear current page.

            Detail = new NavigationPage(displayPage)
            {
                BarBackgroundColor = ColorHelper.ToolbarBackground,
                BarTextColor       = Color.White,
            };

            IsPresented = false;
        }