Esempio n. 1
0
 private void SetMainPage()
 {
     MainPage = new CustomNavigationPage(new MainPage())
     {
         BarBackgroundColor = Color.FromHex("#EDEF00"), BarTextColor = Color.Black
     };
 }
Esempio n. 2
0
 public App()
 {
     InitializeComponent();
     FlowListView.Init();
     //MainPage = new Pages.HomePage();
     MainPage = new CustomNavigationPage(new MainPage());
 }
Esempio n. 3
0
        public App()
        {
            InitializeComponent();

            //MainPage = new MainPage();
            MainPage = new CustomNavigationPage(new MainPage());
        }
Esempio n. 4
0
        void UpdateToolbarTitle(Page lastPage, AppCompatTextView titleTextView, AppCompatTextView subTitleTextView, Typeface originalFont, ColorStateList defaultColorStateList)
        {
            //Check support for CustomPage
            if (lastPage is CustomPage)
            {
                var cPage = lastPage as CustomPage;

                //Update main title formatted text
                UpdateFormattedTitleText(titleTextView, cPage.FormattedTitle, lastPage.Title);

                //Update subtitle text view
                UpdateToolbarSubtitle(cPage, subTitleTextView, originalFont, defaultColorStateList);
            }
            else
            {
                subTitleTextView.TextFormatted = new Java.Lang.String("");
                subTitleTextView.Text          = string.Empty;
                subTitleTextView.Visibility    = ViewStates.Gone;

                //Update main title text
                UpdateTitleText(titleTextView, lastPage.Title);
            }

            //Update main title color
            UpdateToolbarTextColor(titleTextView, CustomNavigationPage.GetTitleColor(lastPage), defaultColorStateList);

            //Update main title font
            UpdateToolbarTextFont(titleTextView, CustomNavigationPage.GetTitleFont(lastPage), originalFont);
        }
Esempio n. 5
0
        public SelectCategory()
        {
            InitializeComponent();

            CustomNavigationPage.SetTitlePosition(this, CustomNavigationPage.TitleAlignment.Center);
            CustomNavigationPage.SetTitleFont(this, Font.SystemFontOfSize(NamedSize.Large));

            CustomNavigationPage.SetGradientColors(this, new Tuple <Color, Color>(Color.FromHex("#17a39d"), Color.FromHex("#17a39d")));

            BindingContext = this;
            //  suggestionlistview.ItemsSource = categ;


            categ.Add(new SearchCat {
                Name = "Shirts", TextColor = Color.Red
            });
            categ.Add(new SearchCat {
                Name = "Books"
            });
            categ.Add(new SearchCat {
                Name = "Mobiles"
            });
            categ.Add(new SearchCat {
                Name = "Laptops"
            });
            categ.Add(new SearchCat {
                Name = "Home Appliances"
            });
            categ.Add(new SearchCat {
                Name = "T-Shirts"
            });
        }
Esempio n. 6
0
        public App()
        {
            Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("MjUzMzk0QDMxMzgyZTMxMmUzMGxWL3JDK20vbWV5SGszZTZlcWIzcHF1Um9EeWtNLzlzdmx0RjQxN1JxY2c9");

            InitializeComponent();

            //注册服务
            ServicesManager.Initialize();

            LoggerHelper.Current.Debug("Initialize OK");

            //创建或者更新Sqlite数据库表
            Task.Run(() => SqliteHelper.Current.CreateOrUpdateAllTablesAsync());

            LoggerHelper.Current.Debug("SqliteHelper.Current.CreateOrUpdateAllTablesAsync OK");

            var fingerprintAvailability = CrossFingerprint.Current.GetAvailabilityAsync(true).Result; //返回当前手机上面可用的指纹

            var isAvailable = CrossFingerprint.Current.IsAvailableAsync(false).Result;                //是否有可用的指纹

            if (fingerprintAvailability == FingerprintAvailability.Available && isAvailable)
            {
                MainPage = new CustomNavigationPage(new FingerprintPage());// new CustomNavigationPage(new MainPage());
            }
            else
            {
                MainPage = new CustomNavigationPage(new MainPage());// new CustomNavigationPage(new MainPage());
            }

            LoggerHelper.Current.Debug("CustomNavigationPage OK");
        }
Esempio n. 7
0
        public App()
        {
            XamlCSS.XamarinForms.Css.Initialize(this);

            InitializeComponent();

            MainPage = new CustomNavigationPage(new MyTripCountdownView());
        }
Esempio n. 8
0
        private void SetupMainPage()
        {
            var container   = _platformInitializer.Build();
            var viewFactory = container.Resolve <IViewFactory>();
            var welcomePage = viewFactory.ResolveView <IWelcomeViewModel>() as Page;

            MainPage = new CustomNavigationPage(welcomePage);
        }
Esempio n. 9
0
        public App()
        {
            InitializeComponent();
            var navPage = new CustomNavigationPage();

            navPage.Navigation.PushAsync(new LoginPage());
            MainPage = navPage;
        }
Esempio n. 10
0
        public App()
        {
            InitializeComponent();
            Akavache.Registrations.Start("Countdown");
            App.vieModel = new PinCountdownViewModel();

            MainPage = new CustomNavigationPage(new PinCountdownView());
        }
        public UpdateUserProfile()
        {
            InitializeComponent();
            CustomNavigationPage.SetTitlePosition(this, CustomNavigationPage.TitleAlignment.Center);
            CustomNavigationPage.SetTitleFont(this, Font.SystemFontOfSize(NamedSize.Large));

            CustomNavigationPage.SetGradientColors(this, new Tuple <Color, Color>(Color.FromHex("#17a39d"), Color.FromHex("#17a39d")));
        }
Esempio n. 12
0
 public IdexMasterDetailPage()
 {
     InitializeComponent();
     CustomNavigationPage.SetHasNavigationBar(this, false);
     MasterBehavior = MasterBehavior.Popover;
     MasterPage.ListView.ItemSelected += ListView_ItemSelected;
     Detail = new CustomNavigationPage(new IdexMainPage());
 }
Esempio n. 13
0
 public App()
 {
     InitializeComponent();
     Plugin.Iconize.Iconize.With(new Plugin.Iconize.Fonts.FontAwesomeSolidModule())
     .With(new Plugin.Iconize.Fonts.FontAwesomeRegularModule())
     .With(new Plugin.Iconize.Fonts.FontAwesomeBrandsModule());
     MainPage = new CustomNavigationPage(new MainPage());
 }
 //keeps one navigationpage per tab to save user's position when he chooses another tab
 public CustomStack()
 {
     NewsContent        = new CustomNavigationPage(new News());
     PlayerContent      = new CustomNavigationPage(new Players());
     MatchContent       = new CustomNavigationPage(new Matches());
     LeagueTableContent = new CustomNavigationPage(new LeagueTable());
     HistoryContent     = new CustomNavigationPage(new History());
 }
Esempio n. 15
0
        public App()
        {
            InitializeComponent();

            TemplateUI.Init();

            MainPage = new CustomNavigationPage(new MainView());
        }
Esempio n. 16
0
 void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
 {
     if (e.Child is TextView textView)
     {
         textView.Typeface = Typeface.CreateFromAsset(Context.Assets, CustomNavigationPage.GetFontFamily(CurrentPage).FontNameToFontFile());
         textView.SetTextSize(ComplexUnitType.Sp, (float)CustomNavigationPage.GetFontSize(CurrentPage));
     }
 }
Esempio n. 17
0
        /// <summary>
        /// Внутренняя навигация к
        /// </summary>
        protected virtual async Task InternalNavigateToAsync(Type viewModelType, object parameter)
        {
            // Создаём и привязываем страницу
            var page = CreateAndBindPage(viewModelType, parameter);

            // Если это главный вид, то присваеваем нашему приложению главную страницу
            if (page is MainView)
            {
                CurrentApplication.MainPage = page;
            }
            // Если это логин создаём CustomNavigationPage на месте главной странице
            else if (page is LoginView)
            {
                CurrentApplication.MainPage = new CustomNavigationPage(page);
            }
            // Если приложение уже имеет главый вид (это master detail)
            else if (CurrentApplication.MainPage is MainView mainPage)
            {
                // И при этом детали это CustomNavigationPage
                if (mainPage.Detail is CustomNavigationPage navigationPage)
                {
                    // Текущая страница
                    var currentPage = navigationPage.CurrentPage;

                    // Если типы не совпадают с созданной ранее страницей
                    if (currentPage.GetType() != page.GetType())
                    {
                        // Показываем страницу модально
                        await navigationPage.PushAsync(page);
                    }
                }
                // Иначе, если детали главной страницы не соответствуют типу CustomNavigationPage
                else
                {
                    // Создаём страницу деталей
                    navigationPage = new CustomNavigationPage(page);
                    // Устанавливаем детали главному виду
                    mainPage.Detail = navigationPage;
                }

                mainPage.IsPresented = false;
            }
            // Всё равно нужно настроить главную страницу
            else
            {
                if (CurrentApplication.MainPage is CustomNavigationPage navigationPage)
                {
                    await navigationPage.PushAsync(page);
                }
                else
                {
                    CurrentApplication.MainPage = new CustomNavigationPage(page);
                }
            }

            // Инициализация вью модели
            await((ViewModelBase)page.BindingContext).InitializeAsync(parameter);
        }
Esempio n. 18
0
        async Task <bool> InitNavigation()
        {
            MainView page = new MainView();

            //SpotifyPlayListView page = new SpotifyPlayListView(null);
            page.BindingContext = MainViewModel.Instance;
            MainPage            = new CustomNavigationPage(page);
            return(true);
        }
Esempio n. 19
0
        private Page CreatePage(Type pageType)
        {
            var page       = (Xamarin.Forms.Page)Activator.CreateInstance(pageType);
            var detailPage = new CustomNavigationPage(page)
            {
            };

            return(detailPage);
        }
Esempio n. 20
0
        protected override void InitializeNavbar()
        {
            CustomNavigationPage.SetTitleColor(this, (Color)Application.Current.Resources["TitleWhite"]);

            CustomNavigationPage.SetTitlePosition(this, CustomNavigationPage.TitleAlignment.Center);
            CustomNavigationPage.SetTitleMargin(this, new Thickness(0, 0, 100, 0));
            // CustomNavigationPage.SetTitleFont(this, (Font)Application.Current.Resources["oswald_semibold"]);
            CustomNavigationPage.SetTitleFontType(this, Device.RuntimePlatform == Device.Android ? "oswald_semibold.ttf" : "Oswald SemiBold");
        }
        public SetPassword(string userid)
        {
            userId = userid;

            InitializeComponent();
            CustomNavigationPage.SetTitlePosition(this, CustomNavigationPage.TitleAlignment.Center);
            CustomNavigationPage.SetTitleFont(this, Font.SystemFontOfSize(NamedSize.Large));

            CustomNavigationPage.SetGradientColors(this, new Tuple <Color, Color>(Color.FromHex("#17a39d"), Color.FromHex("#17a39d")));

            password.Completed += async(s, e) =>
            {
                if (CrossConnectivity.Current.IsConnected)
                {
                    try
                    {
                        Boolean boolisValid = await IsValid();

                        if (boolisValid)
                        {
                            DoneClick();
                        }
                    }
                    catch (Exception ex)
                    {
                        System.Diagnostics.Debug.WriteLine(ex);
                    }
                }
                else
                {
                    await DisplayAlert("Alert", "Please check your internet connection", "OK");
                }
            };
            cpassword.Completed += async(s, e) =>
            {
                if (CrossConnectivity.Current.IsConnected)
                {
                    try
                    {
                        Boolean boolisValid = await IsValid();

                        if (boolisValid)
                        {
                            DoneClick();
                        }
                    }
                    catch (Exception ex)
                    {
                        System.Diagnostics.Debug.WriteLine(ex);
                    }
                }
                else
                {
                    await DisplayAlert("Alert", "Please check your internet connection", "OK");
                }
            };
        }
Esempio n. 22
0
        public App()
        {
            InitializeComponent();
            var pathService = Bootstrapper.Get <IPath>();

            Repository = new Repository <ToDoItem>(new ApplicationContext(pathService.GetDatabasePath(Constants.DbFileName)));
            MainPage   = new CustomNavigationPage(new MainPage());
            Navigation = MainPage.Navigation;
        }
Esempio n. 23
0
        public App()
        {
            InitializeComponent();

            MainPage = new CustomNavigationPage(new MainPage())
            {
                BarBackgroundColor = Color.Red
            };
        }
Esempio n. 24
0
        public async Task NavigateToAsync(Type viewModelType, object parameter)
        {
            try
            {
                var pageType  = _mappings[viewModelType];
                var page      = (Page)Activator.CreateInstance(pageType);                      //create object at run time
                var viewModel = page.BindingContext = Locator.Instance.Resolve(viewModelType); // Link View to ViewModel
                if (page is LoginView)
                {
                    App.Current.MainPage = new NavigationPage(page);
                }
                else if (page is MainView)
                {
                    App.Current.MainPage = page;
                }
                else if (App.Current.MainPage is MainView)
                {
                    var mainPage       = App.Current.MainPage as MainView;
                    var navigationPage = mainPage.Detail as CustomNavigationPage;

                    if (navigationPage != null)
                    {
                        var currentPage = navigationPage.CurrentPage;

                        if (currentPage.GetType() != page.GetType())
                        {
                            await navigationPage.PushAsync(page);
                        }
                    }
                    else
                    {
                        navigationPage  = new CustomNavigationPage(page);
                        mainPage.Detail = navigationPage; // just set detail page, because Master page is Menu Page
                    }

                    mainPage.IsPresented = false;
                }
                else
                {
                    var navigationPage = App.Current.MainPage as CustomNavigationPage;

                    if (navigationPage != null)
                    {
                        await navigationPage.PushAsync(page);
                    }
                    else
                    {
                        App.Current.MainPage = new CustomNavigationPage(page);
                    }
                }
                await((ViewModelBase)viewModel).InitializeAsync(parameter);
            }
            catch (Exception ex)
            {
                Crashes.TrackError(ex);
            }
        }
Esempio n. 25
0
 protected override void InitializeNavbar()
 {
     base.InitializeNavbar();
     if (Device.RuntimePlatform == Device.iOS)
     {
         CustomNavigationPage.SetTitleVisible(this, true);
     }
     CustomNavigationPage.SetTitleMargin(this, new Thickness(20, 0, 0, 0));
 }
Esempio n. 26
0
        protected override void OnAppearing()
        {
            _navPage = _customChart.ChartPage.NavigationPage;
            _navPage.BarBackgroundColor = Color.FromRgb(33, 150, 243);
            _navPage.Elevation          = 0;
            _navPage.BarVisivility      = true;

            base.OnAppearing();
        }
Esempio n. 27
0
        public MainPage()
        {
            InitializeComponent();

            Master = new MenuPage();
            //Detail = new NavigationPage(new HomePage());
            Detail = new CustomNavigationPage(new HomePage());
            Icon   = "icon.png";
        }
Esempio n. 28
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            SetupNavBar(NavigationController.NavigationBar.Bounds.Size);
            SetTitlePosition(CustomNavigationPage.GetTitlePosition(Element), CustomNavigationPage.GetTitlePadding(Element), CustomNavigationPage.GetTitleMargin(Element), new CGRect(0, 0, Math.Max(subtitleLabel.IntrinsicContentSize.Width, titleLabel.IntrinsicContentSize.Width), (titleLabel.IntrinsicContentSize.Height + subtitleLabel.IntrinsicContentSize.Height + (subtitleLabel.IntrinsicContentSize.Height > 0.0f ? 3.0f : 0.0f))));

            //System.Diagnostics.Debug.WriteLine("Preparing");
        }
Esempio n. 29
0
        public App()
        {
            bootstrapper = DIContainer.Instance.Resolve <IBootstrapper>();
            appStore     = DIContainer.Instance.Resolve <IStore <ApplicationState> >();

            InitializeComponent();

            MainPage = new CustomNavigationPage(new RootMasterDetailPage());
        }
Esempio n. 30
0
        private async void OnMainPageCurrentChanged(iOSMainPage mainPage)
        {
            object parameter = null;

            CustomNavigationPage navigation = mainPage.CurrentPage as CustomNavigationPage;


            await InitializeTabPageCurrentPageViewModelAsync(parameter);
        }
Esempio n. 31
0
        public App()
        {

            //var cnt=new ContentPage();
            // The root page of your application
            MainPage = new CustomNavigationPage();//new ContentPage());

            StartApplication();
            //new Views.MainPage());
            //      var cnt = new ContentPage();
            //      var btn = new Button()
            //      {
            //          Text = "test",

            //      };
            //      btn.Clicked += (s, e) =>
            //      {
            //          MainPage.Navigation.PushAsync(new MainPage());
            //      };
            //      cnt.Content = new StackLayout
            //      {
            //          VerticalOptions = LayoutOptions.Center,
            //          Children = {
            //                    btn,
            //                        new Label {
            //                            XAlign = TextAlignment.Center,
            //                            Text = "Welcome to Xamarin Forms!"

            //                        },
            //                        new Label {
            //                            XAlign = TextAlignment.Center,
            //                            Text = "Welcome to Xamarin Forms!"
            //                        },
            //                        new Label {
            //                            XAlign = TextAlignment.Center,
            //                            Text = "Welcome to Xamarin Forms!"
            //                        }

            //                    }


            //      };
            //(MainPage as NavigationPage).Navigation.PushAsync(cnt);
        }