示例#1
0
 protected override void ConfigureApplication(IContainer container)
 {
     var viewFactory = container.Resolve<IViewFactory>();
     var main = viewFactory.Resolve<LoginViewModel>();
     var navPage = new NavigationPage(main); //pone la barra de navegación
     _app.MainPage = navPage;
 }
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            // await a new task
            await Task.Factory.StartNew(async () => {

                // delay for a few seconds on the splash screen
                await Task.Delay(3000);

                // instantiate a NavigationPage with the AcquaintanceListPage
                var navPage = new NavigationPage(new AcquaintanceListPage() { Title = "Acquaintances",  BindingContext = new AcquaintanceListViewModel() });

                // if this is iOS set the nav bar text color
                if (Device.OS == TargetPlatform.iOS)
                    navPage.BarTextColor = Color.White;

                // on the main UI thread, set the MainPage to the navPage
                Device.BeginInvokeOnMainThread(() => {
                    Application.Current.MainPage = navPage;
                });
            });


        }
示例#3
0
 protected override void ConfigureApplication(IContainer container)
 {
     var viewFactory = container.Resolve<IViewFactory>();
     var main = viewFactory.Resolve<LoginViewModel>();
     var np = new NavigationPage(main);
     _application.MainPage = np;
 }
		public App ()
		{
			// The root page of your application
//			MainPage = new GridViewOptions ();
//			MainPage = new GridViewPerformance2 ();
			MainPage = new NavigationPage (new SampleMenu ());
		}
		public App ()
		{
			NavigationPage nav = new NavigationPage ();
			// The root page of your application
			MainPage = nav;
			nav.PushAsync (new HomeCode ());
		}
示例#6
0
 public App()
 {
     InitializeComponent ();
     database = new POCDB ();
     MainPage = new NavigationPage (new WorkingWithBindings());
     //MainPage = new NavigationPage (new Login());
 }
示例#7
0
		protected void CreateMenuPage(string menuPageTitle)
		{
			var _menuPage = new ContentPage ();
			_menuPage.Title = menuPageTitle;
			var listView = new ListView();

			listView.ItemsSource = new string[] { "Contacts", "Quotes", "Modal Demo" };

			listView.ItemSelected += async (sender, args) =>
			{

				switch ((string)args.SelectedItem) {
				case "Contacts":
					_tabbedNavigationPage.CurrentPage = _contactsPage;
					break;
				case "Quotes":
					_tabbedNavigationPage.CurrentPage = _quotesPage;
					break;
				case "Modal Demo":
                    var modalPage = FreshPageModelResolver.ResolvePageModel<ModalPageModel>();
					await PushPage(modalPage, null, true);
					break;
				default:
				break;
				}

				IsPresented = false;
			};

			_menuPage.Content = listView;

			Master = new NavigationPage(_menuPage) { Title = "Menu" };
		}
        public App()
        {
            // Create the ObservableCollection for the Information items.
            InfoCollection = new ObservableCollection<Information>();

            MainPage = new NavigationPage(new DataTransfer4HomePage());
        }
示例#9
0
        public MainMenu()
        {

            var location = DependencyService.Get<IGetLocation>();

            var tabs = new TabbedPage();

            var mapLocation = new MapLocation();
            mapLocation.Title = "Accident Test";
            mapLocation.Icon = "splash";

            var mapNav = new NavigationPage(mapLocation);
            mapNav.Title = "Accident";
            mapNav.Icon = "splash.png";
            tabs.Children.Add(mapNav);

        

          

        

            /*     // demonstrates the Geocoder class
                 tabs.Children.Add(new CustomerDataGather { Title = "Geocode", Icon = "splash.png" });

                 // opens the platform's native Map app
                 tabs.Children.Add(new CustomerDataGather { Title = "Map App", Icon = "splash.png" });

     */
            MainPage = tabs;
        }
示例#10
0
        public App()
        {
            InitializeComponent();
            Current = this;

            MainPage = Navigation = new NavigationPage(new Pages.MainPage());
        }
示例#11
0
 public App()
 {
     // The root page of your application
     MessagingCenter.Subscribe<Zombie>(this, "NavigateToZombie", NavigateToZombie);
     rootNavigationPage = new NavigationPage(new HomeView());
     MainPage = rootNavigationPage;
 }
示例#12
0
        public App()
        {
            App.Self = this;

            var locator = CrossGeolocator.Current;
            locator.DesiredAccuracy = 50;

            var position = locator.GetPositionAsync(timeoutMilliseconds: 10000).ContinueWith((t) =>
           {
               if (t.IsCompleted)
               {
                   if (MyPosition == null)
                       MyPosition = new MyLatLong();
                   MyPosition.Latitude = t.Result.Latitude;
                   MyPosition.Longitude = t.Result.Longitude;
               }
           }).ConfigureAwait(true);

            PositionChanged += (object sender, PositionEventArgs e) =>
            {
                MyPosition.Latitude = e.Position.Latitude;
                MyPosition.Longitude = e.Position.Longitude;
                MessagingCenter.Send<App>(this, "LocChange");
            };

            PositionError += (object sender, PositionErrorEventArgs e) =>
            {
                MessagingCenter.Send<App, string>(this, "LocError", e.Error.ToString());
            };

            CrossGeolocator.Current.StartListeningAsync(1, 50, false);

            MainPage = new NavigationPage(new MappingPage());
        }
示例#13
0
        protected override void ConfigureApplication(IContainer container)
        {

            var viewFactory = container.Resolve<IViewFactory>();
            var txt = DependencyService.Get<IServicioFicheros>().RecuperarTexto(Cadenas.FicheroSettings);
            if (String.IsNullOrEmpty(txt))
            {
                var main = viewFactory.Resolve<LoginViewModel>(viewModel => {
                    viewModel.Titulo = "Login";
                });
                var np = new NavigationPage(main);
                _application.MainPage = np;
            }
            else
            {
                var data=JsonConvert.DeserializeObject<UsuarioModel>(txt);
                Session.User = data;
                var main = viewFactory.Resolve<LoginViewModel>(viewModel => {
                    viewModel.Titulo = "Login";
                });
                var np = new NavigationPage(main);
                _application.MainPage = np;
            }


            
            
        }
示例#14
0
        public App()
        {
            var app = Resolver.Resolve<IXFormsApp>();
            if (app == null)
            {
                return;
            }

            app.Closing += (o, e) => Debug.WriteLine("Application Closing");
            app.Error += (o, e) => Debug.WriteLine("Application Error");
            app.Initialize += (o, e) => Debug.WriteLine("Application Initialized");
            app.Resumed += (o, e) => Debug.WriteLine("Application Resumed");
            app.Rotation += (o, e) => Debug.WriteLine("Application Rotated");
            app.Startup += (o, e) => Debug.WriteLine("Application Startup");
            app.Suspended += (o, e) => Debug.WriteLine("Application Suspended");

            ViewFactory.Register<MainView, MainViewModel>();
            ViewFactory.Register<MapView, MapViewModel>();
            ViewFactory.Register<View.CameraView, CameraViewModel>();
            ViewFactory.Register<CodeScannerView, CodeScannerViewModel>();
            ViewFactory.Register<CommunicationView, CommunicationViewModel>();

            var mainPage = (Page)ViewFactory.CreatePage(typeof(MainViewModel));

            Resolver.Resolve<IDependencyContainer>()
                             .Register<INavigationService>(t => new NavigationService(mainPage.Navigation));
            MainPage = new NavigationPage(mainPage);


            // The root page of your application
           // MainPage =  new View.CameraView();
        }
示例#15
0
        public App()
        {
            // Ensure link to Toolkit library.
            Color color = Xamarin.FormsBook.Toolkit.NamedColor.AliceBlue;

            MainPage = new NavigationPage(new ViewGalleryTypePage());
        }
示例#16
0
		public async Task TestNavigationImplPop ()
		{
			NavigationPage nav = new NavigationPage ();
			
			Label child = new Label ();
			Page childRoot = new ContentPage {Content = child};

			Label child2 = new Label ();
			Page childRoot2 = new ContentPage {Content = child2};
			
			await nav.Navigation.PushAsync (childRoot);
			await nav.Navigation.PushAsync (childRoot2);

			bool fired = false;
			nav.Popped += (sender, e) => fired = true;
			var popped = await nav.Navigation.PopAsync ();

			Assert.True (fired);
			Assert.AreSame (childRoot, nav.CurrentPage);
			Assert.AreEqual (childRoot2, popped);

			await nav.PopAsync ();
			var last = await nav.Navigation.PopAsync ();

			Assert.IsNull (last);
		}
 public App()
 {
     // The root page of your application
     var navPage = new NavigationPage(new MenuView());
     navPage.BarTextColor = Color.White;
     MainPage = navPage;
 }
示例#18
0
        public App()
        {
            var btnCs = new Button()
            {
                Text = "Abas Code Only"
            };
            btnCs.Clicked += btnCs_Clicked;

            var btnXaml = new Button()
            {
                Text = "Abas XAML"
            };
            btnXaml.Clicked += btnXaml_Clicked;

            // The root page of your application
            MainPage = new NavigationPage(new ContentPage
            {
                Content = new StackLayout
                {
                    VerticalOptions = LayoutOptions.Center,
                    Children = {
                        new Label {
                            XAlign = TextAlignment.Center,
                            Text = "Abra uma das Telas"
                        },
                        btnCs,
                        btnXaml
                    }
                }
            });
        }
		public RootMDPNavigationTabbedContentPage (string hierarchy)
		{
			AutomationId = hierarchy + "PageId";


			var tabbedPage = new TabbedPage ();

			var firstTab = new ContentPage {
				//BackgroundColor = Color.Yellow,
				Title = "Testing 123",
				Content = new SwapHierachyStackLayout (hierarchy)
			};

			tabbedPage.Children.Add (firstTab);

			NavigationPage.SetHasNavigationBar (firstTab, false);

			Detail = new NavigationPage (tabbedPage);
			Master = new NavigationPage (new ContentPage {
				Title = "Testing 345",
				Content = new StackLayout {
					Children = {
						new Label { Text = "Hello" },
						new AbsoluteLayout {
							BackgroundColor = Color.Red,
							VerticalOptions = LayoutOptions.FillAndExpand,
							HorizontalOptions = LayoutOptions.FillAndExpand
						},
						new Button { Text = "Button" }
					}
				}
			}) { 
				Title = "Testing 345"
			};
		}
示例#20
0
        void NavigateTo(MenuItem menu)
        {
            Page displayPage;
            var t = typeof(BucketListPage);
            if (menu.TargetType == t)
            {
                var category = menu.Category;
                if (category == null)
                {
                    displayPage = new BucketListPage();
                }
                else
                    displayPage = new BucketListPage(category);
            }
            else
            {
                displayPage = (Page)Activator.CreateInstance(menu.TargetType);
            }

            //            if (menu.TargetType is typeof(BucketListPage))
            //            {
            //                var category = menu.Category;
            //                Page = new BucketListPage
            //            };
            //            Page displayPage = (Page)Activator.CreateInstance (menu.TargetType);

            Detail = new NavigationPage (displayPage);

            IsPresented = false;
        }
		public void Selected (string item) {

			switch (item) {
			case "Sessions":
				if (sessions == null)
					sessions = new NavigationPage (new SessionsPage ()) { Tint = App.NavTint };
				master.Detail = sessions;
				break;
			case "Speakers":
				if (speakers == null) {
					speakers = new NavigationPage (new SpeakersPage ()) { Tint = App.NavTint };
					//TODO: finish WrapLayout demo
//					speakers = new NavigationPage (new SpeakersPageWrap ()) { Tint = App.NavTint };
				}
				master.Detail = speakers;
				break;
			case "Favorites":
				if (favorites == null)
					favorites = new NavigationPage (new FavoritesPage ()) { Tint = App.NavTint };
				master.Detail = favorites;
				break;
			case "Room Plan":
				master.Detail = new NavigationPage(new FloorplanPage()) {Tint = App.NavTint};
				break;
			case "Map":
				master.Detail = new NavigationPage(new MapPage()) {Tint = App.NavTint};
				break;
			case "About":
				master.Detail = new NavigationPage(new AboutPage()) {Tint = App.NavTint};
				break;
			};
			master.IsPresented = false;  // close the slide-out
		}
示例#22
0
 public Page CreatePageForNavigation()
 {
     var newPage = new NavigationPage(_page);
     newPage.BarBackgroundColor = Color.Green;
     newPage.BarTextColor = Color.White;
     return newPage;
 }
示例#23
0
 public App()
 {
     LoginView loginVew = new LoginView();
     loginVew.BindingContext = Container.Instance.Value.Get<LoginViewModel>();
     // The root page of your application
     MainPage = new NavigationPage(loginVew);
 }
示例#24
0
        public App()
        {
            Translation.SetLocale ();

            var netLanguage = DependencyService.Get<ILocale>().GetCurrent();
            AppResources.Culture = new CultureInfo (netLanguage);

            Database = new MediandoDatabase ();
            //SyncData (Database);
            Device.OnPlatform(
                iOS: () => {
                    var homePage = new StartView ();
                    MainPage = homePage;
                },
                Android:() => {
                    var homePage = new NavigationPage (new StartView ()) {
                        BarBackgroundColor = Color.Black,
                        BarTextColor = Color.White,
                    };
                    MainPage = homePage;
                },
                WinPhone:()=>{
                    var homePage = new StartView ();
                    MainPage = homePage;
                }
            );

            App.AppSelected = ApplicationID.Default;
        }
示例#25
0
 public App()
 {
     // Force a language change (for testing purposes)
     language.ChangeLanguage(textLanguage.Portuguese);
     // Set the main page of the application
     MainPage = new NavigationPage(new NavPage());
 }
示例#26
0
		public App ()
		{	
			MainPage = new NavigationPage(new RestaurantList (restaurants));

			MessagingCenter.Subscribe<RestaurantGuide.App, string> (this, "show", async (sender, arg) => {
				// do something whenever the "Hi" message is sent
				Debug.WriteLine("Search argument: " + arg);

				var restaurant = from r in restaurants
						where r.Name == arg
						select r;

				// set initial state
				await MainPage.Navigation.PopToRootAsync ();

				// load screen

				var rPage = new RestaurantDetail ();
				// set BindingContext
				rPage.BindingContext = restaurant.FirstOrDefault();

				// display screen
				await MainPage.Navigation.PushAsync (rPage);
			});
		}
示例#27
0
文件: RootPage.cs 项目: auxua/Qurvey
        /// <summary>
        /// Create the Root Page
        /// Define master and Detail as wenn as the default Detail page
        /// </summary>
        public RootPage()
        {
            var menuPage = new MenuPage ();
            // The effective navigation gets assigned
            menuPage.Menu.ItemSelected += (sender, e) => {
                // Before Navigating, recolor the cell
                if (menuPage.Menu.selected != null) {
                    menuPage.Menu.selected.SetColors (true);
                }

                // Select new
                menuPage.Menu.selected = (menuPage.Menu.SelectedItem as NavMenuItem);
                menuPage.Menu.selected.SetColors (false);

                NavigateTo (e.SelectedItem as NavMenuItem);
            };

            Master = menuPage;
            // Set default Detail page
            if (Device.OS == TargetPlatform.Android)
            {
                Detail = new NavigationPage(new pages.WelcomePage()) { BarBackgroundColor = Color.FromHex("FF4F45") };
            }
            else
            {
                Detail = new NavigationPage(new pages.WelcomePage());
            }
        }
示例#28
0
		public void changeVisiblePage(ContentPage page)
		{
			NavigationPage navPage = new NavigationPage(page);
			navPage.BarBackgroundColor = Theme.getBackgroundColor ();
			navPage.BarTextColor = Theme.getTextColor();
			App.Current.MainPage = navPage;
		}
示例#29
0
        public App()
        {
            InitializeComponent();

            RootPage = new NavigationPage(new Views.Landing { BindingContext = new ViewModels.Landing() });
            MainPage = RootPage;
        }
示例#30
0
        private async void Login(object sender, LoginEventArgs e)
        {
            var dashboardPage = new DashboardPage(_userRepository);
            dashboardPage.GroupChoose += DashboardPageOnGroupChoose;

            MainPage = _navigationPage = new NavigationPage(dashboardPage);
        }
示例#31
0
 public App()
 {
     // The root page of your application
     MainPage = new NavigationPage(new MainPage());
 }
示例#32
0
        public App()
        {
            Button helloWorldButton = new Button();

            helloWorldButton.Text = "Hello world";

            Button planarSubdivisionButton = new Button();

            planarSubdivisionButton.Text = "Planar Subdivision";

            Button sceneTextDetectionButton = new Button();

            sceneTextDetectionButton.Text = "Scene Text detection (DNN Module)";

            Button featureDetectionButton = new Button();

            featureDetectionButton.Text = "Feature Matching";

            Button shapeDetectionButton = new Button();

            shapeDetectionButton.Text = "Shape Detection";

            Button pedestrianDetectionButton = new Button();

            pedestrianDetectionButton.Text = "Pedestrian Detection";



            Button maskRcnnButton = new Button();

            maskRcnnButton.Text = "Mask RCNN (DNN module)";

            Button yoloButton = new Button();

            yoloButton.Text = "Yolo (DNN module)";

            Button stopSignDetectionButton = new Button();

            stopSignDetectionButton.Text = "Stop Sign Detection (DNN module)";

            Button licensePlateRecognitionButton = new Button();

            licensePlateRecognitionButton.Text = "License Plate Recognition (DNN Module)";

            List <View> buttonList = new List <View>()
            {
                helloWorldButton,
                planarSubdivisionButton,
                sceneTextDetectionButton,
                featureDetectionButton,
                shapeDetectionButton,
                pedestrianDetectionButton,
                maskRcnnButton,
                stopSignDetectionButton,
                yoloButton,
                licensePlateRecognitionButton
            };

            var  openCVConfigDict = CvInvoke.ConfigDict;
            bool haveViz          = (openCVConfigDict["HAVE_OPENCV_VIZ"] != 0);
            bool haveDNN          = (openCVConfigDict["HAVE_OPENCV_DNN"] != 0);
            bool haveFreetype     = (openCVConfigDict["HAVE_OPENCV_FREETYPE"] != 0);
            bool haveFace         = (openCVConfigDict["HAVE_OPENCV_FACE"] != 0);
            bool haveObjdetect    = (openCVConfigDict["HAVE_OPENCV_OBJDETECT"] != 0);
            bool haveTesseract    = (openCVConfigDict["HAVE_EMGUCV_TESSERACT"] != 0);

            if (haveTesseract)
            {
                Button ocrButton = new Button();
                ocrButton.Text = "Tesseract OCR";
                buttonList.Add(ocrButton);

                ocrButton.Clicked += (sender, args) =>
                {
                    ProcessAndRenderPage ocrPage = new ProcessAndRenderPage(
                        new TesseractModel(),
                        "Perform Text Detection",
                        "test_image.png",
                        "");
                    ocrPage.HasCameraOption = false;
                    MainPage.Navigation.PushAsync(ocrPage);
                };
            }

            if (haveObjdetect)
            {
                Button faceDetectionButton = new Button();
                faceDetectionButton.Text = "Face Detection (CascadeClassifier)";
                buttonList.Add(faceDetectionButton);

                faceDetectionButton.Clicked += (sender, args) =>
                {
                    ProcessAndRenderPage faceAndEyeDetectorPage = new ProcessAndRenderPage(
                        new CascadeFaceAndEyeDetector(),
                        "Face and eye detection (Cascade classifier)",
                        "lena.jpg",
                        "Cascade classifier");
                    MainPage.Navigation.PushAsync(faceAndEyeDetectorPage);
                };
            }

            if (haveFace && haveDNN)
            {
                Button faceLandmarkDetectionButton = new Button();
                faceLandmarkDetectionButton.Text = "Face Landmark Detection (DNN Module)";
                buttonList.Add(faceLandmarkDetectionButton);
                faceLandmarkDetectionButton.Clicked += (sender, args) =>
                {
                    ProcessAndRenderPage faceLandmarkDetectionPage = new ProcessAndRenderPage(
                        new FaceAndLandmarkDetector(),
                        "Perform Face Landmark Detection",
                        "lena.jpg",
                        "");
                    MainPage.Navigation.PushAsync(faceLandmarkDetectionPage);
                };
            }

            bool hasInferenceEngine = false;

            if (haveDNN)
            {
                var dnnBackends = DnnInvoke.AvailableBackends;
                hasInferenceEngine = Array.Exists(dnnBackends, dnnBackend =>
                                                  (dnnBackend.Backend == Dnn.Backend.InferenceEngine ||
                                                   dnnBackend.Backend == Dnn.Backend.InferenceEngineNgraph ||
                                                   dnnBackend.Backend == Dnn.Backend.InferenceEngineNnBuilder2019));
            }

            if (haveViz)
            {
                Button viz3dButton = new Button();
                viz3dButton.Text = "Simple 3D reconstruction";

                buttonList.Add(viz3dButton);

                viz3dButton.Clicked += (sender, args) =>
                {
                    using (Mat left = CvInvoke.Imread("imL.png", ImreadModes.Color))
                        using (Mat right = CvInvoke.Imread("imR.png", ImreadModes.Color))
                            using (Mat points = new Mat())
                                using (Mat colors = new Mat())
                                {
                                    Simple3DReconstruct.GetPointAndColor(left, right, points, colors);
                                    Viz3d v = Simple3DReconstruct.GetViz3d(points, colors);
                                    v.Spin();
                                }
                };
            }

            if (haveFreetype)
            {
                Button freetypeButton = new Button();
                freetypeButton.Text = "Free Type";

                buttonList.Add(freetypeButton);

                freetypeButton.Clicked += (sender, args) =>
                {
                    MainPage.Navigation.PushAsync(new FreetypePage());
                };
            }

            StackLayout buttonsLayout = new StackLayout
            {
                VerticalOptions = LayoutOptions.Start,
            };

            foreach (View b in buttonList)
            {
                buttonsLayout.Children.Add(b);
            }

            // The root page of your application
            ContentPage page =
                new ContentPage()
            {
                Content = new ScrollView()
                {
                    Content = buttonsLayout,
                }
            };

            String aboutIcon = null;

            /*
             * String aboutIcon;
             * if (Emgu.Util.Platform.OperationSystem == Emgu.Util.Platform.OS.IOS)
             * {
             *  aboutIcon = null;
             * }
             * else if (Emgu.Util.Platform.ClrType == Emgu.Util.Platform.Clr.NetFxCore)
             *  aboutIcon = null;
             * else
             *  aboutIcon = "questionmark.png";*/

            NavigationPage navigationPage = new NavigationPage(page);

            MainPage = navigationPage;

            //Fix for UWP navigation text
            if (Device.RuntimePlatform == Device.WPF)
            {
                navigationPage.BarTextColor = Color.Green;
            }


            ToolbarItem aboutItem = new ToolbarItem("About", aboutIcon,
                                                    () =>
            {
                MainPage.Navigation.PushAsync(new AboutPage());
                //page.DisplayAlert("Emgu CV Examples", "App version: ...", "Ok");
            }
                                                    );

            page.ToolbarItems.Add(aboutItem);

            helloWorldButton.Clicked += (sender, args) => { MainPage.Navigation.PushAsync(new HelloWorldPage()); };

            planarSubdivisionButton.Clicked += (sender, args) =>
            {
                MainPage.Navigation.PushAsync(new PlanarSubdivisionPage());
            };



            shapeDetectionButton.Clicked += (sender, args) =>
            {
                ProcessAndRenderPage shapeDetectionPage = new ProcessAndRenderPage(
                    new ShapeDetector(),
                    "Shape detection",
                    "pic3.png",
                    "Shape detection");
                MainPage.Navigation.PushAsync(shapeDetectionPage);
            };

            pedestrianDetectionButton.Clicked += (sender, args) =>
            {
                ProcessAndRenderPage pedestrianDetectorPage = new ProcessAndRenderPage(
                    new PedestrianDetector(),
                    "Pedestrian detection",
                    "pedestrian.png",
                    "HOG pedestrian detection");
                MainPage.Navigation.PushAsync(pedestrianDetectorPage);
            };

            featureDetectionButton.Clicked += (sender, args) =>
            {
                MainPage.Navigation.PushAsync(new FeatureMatchingPage());
            };

            licensePlateRecognitionButton.Clicked += (sender, args) =>
            {
                ProcessAndRenderPage vehicleLicensePlateDetectorPage = new ProcessAndRenderPage(
                    new VehicleLicensePlateDetector(),
                    "Perform License Plate Recognition",
                    "cars_license_plate.png",
                    "This demo is based on the security barrier camera demo in the OpenVino model zoo. The models is trained with BIT-vehicle dataset. License plate is trained based on Chinese license plate that has white character on blue background. You will need to re-train your own model if you intend to use this in other countries.");
                Picker p = vehicleLicensePlateDetectorPage.Picker;
                p.IsVisible = true;
                p.Title     = "Preferred DNN backend & target";

                foreach (String option in GetDnnBackends())
                {
                    p.Items.Add(option);
                }
                MainPage.Navigation.PushAsync(vehicleLicensePlateDetectorPage);
            };

            maskRcnnButton.Clicked += (sender, args) =>
            {
                ProcessAndRenderPage maskRcnnPage = new ProcessAndRenderPage(
                    new MaskRcnn(),
                    "Mask-rcnn Detection",
                    "dog416.png",
                    "");
                Picker p = maskRcnnPage.Picker;
                p.IsVisible = true;
                p.Title     = "Preferred DNN backend & target";

                foreach (String option in GetDnnBackends())
                {
                    p.Items.Add(option);
                }

                MainPage.Navigation.PushAsync(maskRcnnPage);
            };


            sceneTextDetectionButton.Clicked += (sender, args) =>
            {
                ProcessAndRenderPage sceneTextDetectionPage = new ProcessAndRenderPage(
                    new SceneTextDetector(),
                    "Perform Scene Text Detection",
                    "cars_license_plate.png",
                    "This model is trained on MSRA-TD500, so it can detect both English and Chinese text instances.");
                MainPage.Navigation.PushAsync(sceneTextDetectionPage);
            };
            stopSignDetectionButton.Clicked += (sender, args) =>
            {
                MaskRcnn model = new MaskRcnn();
                model.ObjectsOfInterest = new string[] { "stop sign" };
                ProcessAndRenderPage stopSignDetectionPage = new ProcessAndRenderPage(
                    model,
                    "Mask-rcnn Detection",
                    "stop-sign.jpg",
                    "Stop sign detection using Mask RCNN");
                Picker p = stopSignDetectionPage.Picker;
                p.IsVisible = true;
                p.Title     = "Preferred DNN backend & target";

                foreach (String option in GetDnnBackends())
                {
                    p.Items.Add(option);
                }
                MainPage.Navigation.PushAsync(stopSignDetectionPage);
            };
            yoloButton.Clicked += (sender, args) =>
            {
                ProcessAndRenderPage yoloPage = new ProcessAndRenderPage(
                    new Yolo(),
                    "Yolo Detection",
                    "dog416.png",
                    "");
                Picker p = yoloPage.Picker;
                p.Title     = "Yolo model version";
                p.IsVisible = true;
                p.Items.Add("YoloV4");
                p.Items.Add("YoloV4Tiny");
                p.Items.Add("YoloV3");
                p.Items.Add("YoloV3Spp");
                p.Items.Add("YoloV3Tiny");
                MainPage.Navigation.PushAsync(yoloPage);
            };



            maskRcnnButton.IsVisible = haveDNN;
            //faceLandmarkDetectionButton.IsVisible = haveDNN;
            stopSignDetectionButton.IsVisible = haveDNN;
            yoloButton.IsVisible = haveDNN;
            sceneTextDetectionButton.IsVisible      = haveDNN && haveFreetype;
            licensePlateRecognitionButton.IsVisible = hasInferenceEngine;
        }
示例#33
0
        public ForecastPage(RootPage rootPage, Forecast forecast)
        {
            this._rootPage = rootPage;
            _forecast      = forecast;
            BindingContext = new ForecastViewModel(Navigation, _forecast);

            NavigationPage.SetHasNavigationBar(this, false);

            var masterGrid = new Grid {
                RowDefinitions = new RowDefinitionCollection {
                    new RowDefinition {
                        Height = new GridLength(0.3, GridUnitType.Star)
                    },
                    new RowDefinition {
                        Height = new GridLength(0.3, GridUnitType.Star)
                    },
                    new RowDefinition {
                        Height = new GridLength(0.4, GridUnitType.Star)
                    }
                },
                ColumnDefinitions = new ColumnDefinitionCollection {
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    }
                }
            };

            var forecastListview = new ListView();

            var forecastListviewItemTemplate = new DataTemplate(typeof(ImageCell));

            forecastListviewItemTemplate.SetBinding(ImageCell.TextProperty, "ItemTemplateTextProperty");
            forecastListviewItemTemplate.SetValue(ImageCell.TextColorProperty, Color.FromHex("#3498DB"));
            forecastListviewItemTemplate.SetBinding(ImageCell.DetailProperty, "ItemTemplateDetailProperty");
            forecastListviewItemTemplate.SetValue(ImageCell.DetailColorProperty, Color.White);
            forecastListviewItemTemplate.SetBinding(ImageCell.ImageSourceProperty, "Icon");

            forecastListview.ItemTemplate = forecastListviewItemTemplate;
            forecastListview.SetBinding <ForecastViewModel> (ListView.ItemsSourceProperty, vm => vm.WeatherList);

            var refreshImage = new ImageButton()
            {
                Image = "Refresh",
                ImageHeightRequest = 70,
                ImageWidthRequest  = 70,
                BorderColor        = Color.Transparent,
                VerticalOptions    = LayoutOptions.Start,
                BackgroundColor    = Color.Transparent
            };

            refreshImage.Clicked += (object sender, EventArgs e) => {
                _rootPage.ShowLoadingDialog();
            };

            var topGrid = new Grid {
                RowDefinitions = new RowDefinitionCollection {
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Star)
                    }
                },
                ColumnDefinitions = new ColumnDefinitionCollection {
                    new ColumnDefinition {
                        Width = new GridLength(0.8, GridUnitType.Star)
                    },
                    new ColumnDefinition {
                        Width = new GridLength(0.2, GridUnitType.Star)
                    },
                }
            };

            topGrid.Children.Add(CreateForecastStatusStackLayout(), 0, 0);
            topGrid.Children.Add(refreshImage, 1, 0);

            masterGrid.Children.Add(topGrid, 0, 0);
            masterGrid.Children.Add(CreateMiddleStackLayout(), 0, 1);
            masterGrid.Children.Add(forecastListview, 0, 2);

            Content = masterGrid;
        }
示例#34
0
        public App()
        {
            InitializeComponent();

            MainPage = new NavigationPage(new ItemsPage());
        }
示例#35
0
        public MainTopTabbedPage()
        {
            _mainTopTabbedPageViewModel = App.Locator.MainTopTabbedPageViewModel;
            InitializeComponent();
            BindingContext = _mainTopTabbedPageViewModel;
            NavigationPage.SetBackButtonTitle(this, "");
            tabbedControl.Titles = new List <TabModel>()
            {
                new TabModel()
                {
                    Name         = "",
                    Icon         = "ic_folder.png",
                    SelectedIcon = "ic_folder_selected.png"
                },
                new TabModel()
                {
                    Name         = "",
                    Icon         = "ic_folder.png",
                    SelectedIcon = "ic_folder_selected.png"
                },
                new TabModel()
                {
                    Name         = "",
                    Icon         = "ic_folder.png",
                    SelectedIcon = "ic_folder_selected.png"
                },
                new TabModel()
                {
                    Name         = "",
                    Icon         = "ic_folder.png",
                    SelectedIcon = "ic_folder_selected.png"
                }
            };

            tabbedControl.Views = new List <View>()
            {
                new HomeView(),
                new TaskListView(),
                new StackLayout(),
                new StackLayout()
            };
            tabbedControl.PositionChanged += (s, e) =>
            {
                switch (e)
                {
                case 0:
                    Title = "Overview";
                    break;

                case 1:
                    Title = "Task Board";
                    break;

                case 2:
                    Title = "";
                    break;

                default:
                    break;
                }
            };
        }
示例#36
0
 public MenuSat()
 {
     InitializeComponent();
     NavigationPage.SetHasNavigationBar(this, false);
 }
示例#37
0
 public App()
 {
     MainPage = new NavigationPage(new MonkeeListPage());
     Refractored.Xam.TTS.CrossTextToSpeech.Current.Init();
 }
示例#38
0
 public App()
 {
     MainPage = new NavigationPage(new HomePage());
 }
 private async Task EditItem()
 {
     var editPage = new NavigationPage(new EditItemPage(viewModel));
     await Navigation.PushModalAsync(editPage);
 }
        public App()
        {
            InitializeComponent();

            MainPage = new NavigationPage(new FirstTabbedPage());
        }
 public AddPerson(string fk)
 {
     InitializeComponent();
     BindingContext = new AddPersonViewModel(Navigation, fk);
     NavigationPage.SetHasNavigationBar(this, false);
 }
        public MainPage()
        {
            InitializeComponent();

            CrossConnectivity.Current.ConnectivityChanged += async(sender, args) =>
            {
                if (!CrossConnectivity.Current.IsConnected && !wasNotConn)
                {
                    wasNotConn = true;

                    await Navigation.PushModalAsync(new NoConnection());
                }
                else
                {
                    wasNotConn = false;
                }
            };

            NavigationPage.SetHasBackButton(this, false);
            NavigationPage.SetHasNavigationBar(this, false);

            Device.BeginInvokeOnMainThread(() =>
            {
                var homePage = new HomePage();

                var navigationHomePage = new NavigationPage(homePage);
                //navigationHomePage.Title = "Főmenü";
                navigationHomePage.Icon  = GlobalVariables.homepng;
                navigationHomePage.Style = GlobalVariables.NavigationPageStyle;
                NavigationPage.SetHasNavigationBar(homePage, false);

                var searchPage           = new SearchPage();
                var navigationSearchPage = new NavigationPage(searchPage);
                //navigationSearchPage.Title = "Keresés";
                navigationSearchPage.Icon  = GlobalVariables.searchpng;
                navigationSearchPage.Style = GlobalVariables.NavigationPageStyle;
                NavigationPage.SetHasNavigationBar(searchPage, false);

                var peopleSearchPage           = new PeopleSearchPage();
                var navigationPeopleSearchPage = new NavigationPage(peopleSearchPage);
                //navigationMyAccountPage.Title = "Fiók";
                navigationPeopleSearchPage.Icon  = GlobalVariables.peoplepng;
                navigationPeopleSearchPage.Style = GlobalVariables.NavigationPageStyle;
                NavigationPage.SetHasNavigationBar(peopleSearchPage, false);

                var uploadPhotoPage           = new UploadPhotoPage();
                var navigationUploadPhotoPage = new NavigationPage(uploadPhotoPage);
                //navigationUploadPhotoPage.Title = "Fotó";
                navigationUploadPhotoPage.Icon  = GlobalVariables.camerapng;
                navigationUploadPhotoPage.Style = GlobalVariables.NavigationPageStyle;
                NavigationPage.SetHasNavigationBar(uploadPhotoPage, false);

                var myAccountPage           = new MyAccountPage();
                var navigationMyAccountPage = new NavigationPage(myAccountPage);
                //navigationMyAccountPage.Title = "Fiók";
                navigationMyAccountPage.Icon  = GlobalVariables.profilepng;
                navigationMyAccountPage.Style = GlobalVariables.NavigationPageStyle;
                NavigationPage.SetHasNavigationBar(myAccountPage, false);

                Children.Add(navigationHomePage);
                Children.Add(navigationSearchPage);
                Children.Add(navigationPeopleSearchPage);
                Children.Add(navigationUploadPhotoPage);
                Children.Add(navigationMyAccountPage);
            });
        }
示例#43
0
        protected override void OnAttachedTo(Page bindable)
        {
            base.OnAttachedTo(bindable);

            NavigationPage.SetHasNavigationBar(bindable, false);
        }
示例#44
0
 public App()
 {
     InitializeComponent();
     MainPage = new NavigationPage(new LoginRegisterPage());
     //MainPage = new mapTestPage();
 }
 public InternalTabbedPage(NavigationPage navigationPage)
 {
     _navigationPage = navigationPage;
     Children.Add(Issue2338TestHelper.CreateSuccessPage(nameof(Issue2338_SwapMainPageDuringAppearing)));
 }
 public App()
 {
     InitializeComponent();
     MainPage = new NavigationPage(new AzureStoragePoCPage());
 }
示例#47
0
 public Consumo()
 {
     InitializeComponent();
     NavigationPage.SetHasBackButton(this, false);
     //listaArquivo.ItemsSource = lista;
 }
 public RegisterPage()
 {
     InitializeComponent();
     NavigationPage.SetHasNavigationBar(this, false);
 }
示例#49
0
 public App()
 {
     InitializeComponent();
     XF.Material.Forms.Material.Init(this);
     MainPage = new NavigationPage(new LoginPage());
 }
示例#50
0
 public ViewB()
 {
     InitializeComponent();
     NavigationPage.SetHasBackButton(this, false);
 }
示例#51
0
        public App()
        {
            InitializeComponent();

            MainPage = new NavigationPage(new MapView());
        }
示例#52
0
 public Ocho_4_2()
 {
     InitializeComponent();
     NavigationPage.SetHasNavigationBar(this, false);
 }
示例#53
0
 public LoginPage()
 {
     NavigationPage.SetHasNavigationBar(this, false);
     InitializeComponent();
     BindingContext = new LoginVM(Navigation, btnLogin);
 }
示例#54
0
 public App()
 {
     InitializeComponent();
     MainPage = new NavigationPage(new ListEntryPage());
 }
示例#55
0
 public VoucherView()
 {
     InitializeComponent();
     NavigationPage.SetHasNavigationBar(this, false);
     BindingContext = _ViewController.InputObject;
 }
示例#56
0
 public NotificationsPage()
 {
     InitializeComponent();
     NavigationPage.SetHasNavigationBar(this, false);
     MyListView.ItemsSource = null;
 }
示例#57
0
        public App()
        {
            InitializeComponent();

            MainPage = new NavigationPage(new StackLayout.MainPage());
        }
示例#58
0
        public App()
        {
            InitializeComponent();

            MainPage = new NavigationPage(new Sample.TestCircle());
        }
示例#59
0
文件: App.cs 项目: jspuij/Mac.Digital
        /// <summary>
        /// Initializes a new instance of the <see cref="App"/> class.
        /// </summary>
        /// <param name="fileProvider">The file provider to use to fetch the resources for the platform.</param>
        public App(IFileProvider fileProvider = null)
        {
            var hostBuilder = MobileBlazorBindingsHost.CreateDefaultBuilder()
                              .ConfigureServices((hostContext, services) =>
            {
                services.UseMicrosoftDependencyResolver();
                var resolver = Locator.CurrentMutable;
                resolver.InitializeSplat();
                resolver.InitializeReactiveUI();

                // Adds web-specific services such as NavigationManager
                services.AddBlazorHybrid();

                // Register app-specific services
                services.AddBlazorise(options =>
                {
                    options.ChangeTextOnKeyPress = true;
                })
                .AddBootstrapProviders()
                .AddFontAwesomeIcons();

                // Default command timeout is 3 seconds.
                services.AddSingleton <ICommandPolicyProvider>(s
                                                               => new DelegateCommandPolicyProvider(() => Policy.TimeoutAsync(3)));

#if SIMULATION
                services.AddScoped(s => new ServiceSimulation(SynchronizationContext.Current, 10, false, 0m, 1.2m, 0m, 0m, false));
                services.AddScoped <IPowerService>(s => s.GetRequiredService <ServiceSimulation>());
                services.AddScoped <IBoilerService>(s => s.GetRequiredService <ServiceSimulation>());
#endif

                services.AddSingleton <ITitleService, TitleService>();
                services.AddScoped <MachineOffCheckViewModel>();
                services.AddScoped <HeaderViewModel>();
                services.AddScoped <BoilerViewModel>();
            })
                              .ConfigureLogging(loggingBuilder =>
            {
                loggingBuilder.AddSplat();
            })
                              .UseWebRoot("wwwroot");

            if (fileProvider != null)
            {
                hostBuilder.UseStaticFiles(fileProvider);
            }
            else
            {
                hostBuilder.UseStaticFiles();
            }

            var host = hostBuilder.Build();

            host.Services.UseMicrosoftDependencyResolver();

            host.Services
            .UseBootstrapProviders()
            .UseFontAwesomeIcons();

            this.MainPage = new ContentPage {
                Title = "My Application"
            };
            NavigationPage.SetHasNavigationBar(this.MainPage, false);
            host.AddComponent <Main>(parent: this.MainPage);
        }
示例#60
0
        public App()
        {
            var scrollView = new Button {
                Text = "ScrollView"
            };
            var scrollViewXaml = new Button {
                Text = "ScrollView Xaml"
            };
            var listView = new Button {
                Text = "ListView"
            };
            var stackLayout = new Button {
                Text = "StackLayout"
            };
            var grid = new Button {
                Text = "Grid"
            };
            var scrollViewIn = new Button {
                Text = "ScrollView"
            };
            var listViewIn = new Button {
                Text = "ListView"
            };
            var stackLayoutIn = new Button {
                Text = "StackLayout"
            };
            var gridIn = new Button {
                Text = "Grid"
            };
            var disposeCrash = new Button {
                Text = "Dispose Crash"
            };


            scrollViewPage = new ScrollViewPage(false);
            Page page;

            // The root page of your application
            MainPage = page = new NavigationPage(new ContentPage
            {
                Title   = "Pull to Refresh!",
                Content = new ScrollView
                {
                    Content = new StackLayout
                    {
                        Padding  = 25,
                        Children =
                        {
                            new Label
                            {
                                Text = "Pull to Refresh in:"
                            },
                            scrollView,
                            listView,
                            stackLayout,
                            grid,
                            scrollViewXaml,
                            new Label
                            {
                                Text = "Inside a layout:"
                            },
                            scrollViewIn,
                            listViewIn,
                            stackLayoutIn,
                            gridIn,
                            new Label
                            {
                                Text = "Misc"
                            },
                            disposeCrash
                        }
                    }
                }
            })
            {
                BackgroundColor = Color.FromHex("3498db"),
                BarTextColor    = Color.White
            };

            scrollView.Clicked += async(sender, e) =>
            {
                var page2 = new ScrollViewXamlPage();
                await page.Navigation.PushAsync(scrollViewPage);

                await scrollViewPage.Navigation.PushAsync(page2);
            };
            scrollViewXaml.Clicked += (sender, e) => page.Navigation.PushAsync(new ScrollViewXamlPage());
            scrollViewIn.Clicked   += (sender, e) => page.Navigation.PushAsync(new ScrollViewPage(true));
            listView.Clicked       += (sender, e) => page.Navigation.PushAsync(new ListViewPage(false));
            listViewIn.Clicked     += (sender, e) => page.Navigation.PushAsync(new ListViewPage(true));
            stackLayout.Clicked    += (sender, e) => page.Navigation.PushAsync(new StackLayoutPage(false));
            stackLayoutIn.Clicked  += (sender, e) => page.Navigation.PushAsync(new StackLayoutPage(true));
            grid.Clicked           += (sender, e) => page.Navigation.PushAsync(new GridPage(false));
            gridIn.Clicked         += (sender, e) => page.Navigation.PushAsync(new GridPage(true));
            disposeCrash.Clicked   += (sender, e) => MainPage = new DisposeCrashPage();
        }