Exemple #1
0
        //private INavigationService _navigationService;

        public Networks()
        {
            InitializeComponent();

            //var bar = new ToolbarItem("\uf015", "", () =>
            //{
            //    //Device.BeginInvokeOnMainThread(() =>
            //    //{
            //    //    DisplayAlert("提示", "抱歉,功能稍后开放...", "取消");
            //    //});
            //});

            //bar.SetBinding(ToolbarItem.CommandProperty, "GotoHomeCmd");
            //this.ToolbarItems.Remove(bar);
            //MessagingCenter.Subscribe<NavigationMessage>(this, "GotoHomeToolbarItem", (args) =>
            //{
            //    this.ToolbarItems.Add(bar);
            //});

            CustomNavigationPage.SetHasNavigationBar(this, true);
            CustomNavigationPage.SetHasBackButton(this, true);

            CustomNavigationPage.SetTitleMargin(this, new Thickness(0, 0, 5, 0));
            CustomNavigationPage.SetTitleColor(this, Color.White);
            CustomNavigationPage.SetSubtitleColor(this, Color.White);
            CustomNavigationPage.SetTitlePosition(this, CustomNavigationPage.TitleAlignment.Start);
            CustomNavigationPage.SetTitleFont(this, Font.SystemFontOfSize(NamedSize.Large));
            CustomNavigationPage.SetHasShadow(this, true);
            CustomNavigationPage.SetTitlePadding(this, new Thickness(0, 0, 0, 0));
            //渐变从左到右
            CustomNavigationPage.SetGradientColors(this, new Tuple <Color, Color>(Color.FromHex("#5178bd"), Color.FromHex("#7fadf7")));
            CustomNavigationPage.SetGradientDirection(this, CustomNavigationPage.GradientDirection.RightToLeft);

            Title = "我的网点列表";
        }
Exemple #2
0
        public async Task ClearNavigationForPage(Type type)
        {
            CustomNavigationPage page = GetTabPageWithInitial(type);

            if (page != null)
            {
                await page.Navigation.PopToRootAsync(false);
            }
        }
Exemple #3
0
        private CustomNavigationPage GetTabPageWithInitial(Type type)
        {
            CustomNavigationPage page = Children.OfType <CustomNavigationPage>()
                                        .FirstOrDefault(p =>
            {
                return(p.CurrentPage.Navigation.NavigationStack.Count > 0
                                                        ? p.CurrentPage.Navigation.NavigationStack[0].GetType() == type
                                                        : false);
            });

            return(page);
        }
Exemple #4
0
        public bool TrySetCurrentPage(Type requiredPageType)
        {
            CustomNavigationPage page = GetTabPageWithInitial(requiredPageType);

            if (page != null)
            {
                CurrentPage = null;
                CurrentPage = page;
            }

            return(page != null);
        }
        //public List<TraditionSalesInfo> Products = new List<TraditionSalesInfo>();
        public Tradition_Card_Page3()
        {
            Title = "添加传统终端普查-合作信息";
            InitializeComponent();

            CustomNavigationPage.SetTitleIcon(this, "icon.png");
            CustomNavigationPage.SetHasNavigationBar(this, true);
            CustomNavigationPage.SetHasBackButton(this, true);

            CustomNavigationPage.SetTitleMargin(this, new Thickness(0, 0, 5, 0));
            CustomNavigationPage.SetTitleColor(this, Color.White);
            CustomNavigationPage.SetSubtitleColor(this, Color.White);
            CustomNavigationPage.SetTitlePosition(this, CustomNavigationPage.TitleAlignment.Start);
            CustomNavigationPage.SetTitleFont(this, Font.SystemFontOfSize(NamedSize.Large));
            CustomNavigationPage.SetHasShadow(this, true);
            CustomNavigationPage.SetTitlePadding(this, new Thickness(0, 0, 0, 0));
            //渐变从左到右
            CustomNavigationPage.SetGradientColors(this, new Tuple <Color, Color>(Color.FromHex("#5178bd"), Color.FromHex("#7fadf7")));
            CustomNavigationPage.SetGradientDirection(this, CustomNavigationPage.GradientDirection.RightToLeft);

            //


            //var moreAction = new MenuItem { Text = "More" };
            //moreAction.SetBinding(MenuItem.CommandParameterProperty, new Binding("."));
            //moreAction.Clicked += async (sender, e) => {
            //    var mi = ((MenuItem)sender);
            //    Debug.WriteLine("More Context Action clicked: " + mi.CommandParameter);
            //};
            //var deleteAction = new MenuItem { Text = "Delete", IsDestructive = true }; // red background
            //deleteAction.SetBinding(MenuItem.CommandParameterProperty, new Binding("."));
            //deleteAction.Clicked += async (sender, e) => {
            //    var mi = ((MenuItem)sender);
            //    Debug.WriteLine("Delete Context Action clicked: " + mi.CommandParameter);
            //};
            //// add to the ViewCell's ContextActions property
            //ContextActions.Add(moreAction);
            //ContextActions.Add(deleteAction);

            //this.ContextDemoList.SeparatorVisibility = SeparatorVisibility.None;
            //this.ContextDemoList.SeparatorColor = Color.Gray;
            //Effects.Add(Effect.Resolve($"MyEffects.ListViewHighlightEffect"));

            this.ContextDemoList.Effects.Add(Effect.Resolve($"MyCensus.ListViewHighlightEffect"));
            //product = new TraditionSalesInfo() { ProductName = "雪花纯生" };
            //Products.Add(product);
            //this.ContextDemoList.ItemsSource = Products;
        }
Exemple #6
0
        //Timer _dispatcherTimer;
        //计数
        //int sec = 10;

        public SiteMap()
        {
            InitializeComponent();

            CustomNavigationPage.SetTitleIcon(this, "icon.png");
            CustomNavigationPage.SetHasNavigationBar(this, true);
            CustomNavigationPage.SetHasBackButton(this, true);

            CustomNavigationPage.SetTitleMargin(this, new Thickness(0, 0, 5, 0));
            CustomNavigationPage.SetTitleColor(this, Color.White);
            CustomNavigationPage.SetSubtitleColor(this, Color.White);
            CustomNavigationPage.SetTitlePosition(this, CustomNavigationPage.TitleAlignment.Start);
            CustomNavigationPage.SetTitleFont(this, Font.SystemFontOfSize(NamedSize.Large));
            CustomNavigationPage.SetHasShadow(this, true);
            CustomNavigationPage.SetTitlePadding(this, new Thickness(0, 0, 0, 0));
            //渐变从左到右
            CustomNavigationPage.SetGradientColors(this, new Tuple <Color, Color>(Color.FromHex("#5178bd"), Color.FromHex("#7fadf7")));
            CustomNavigationPage.SetGradientDirection(this, CustomNavigationPage.GradientDirection.RightToLeft);


            //tick为执行防范
            //TimerCallback timerDelegate = new TimerCallback(Tick);
            //_dispatcherTimer = new Timer(timerDelegate, null, 0, 1000);


            Title = "定位当前位置";
            //http://www.cnblogs.com/jtang/p/4698496.html
            //http://www.cnblogs.com/loda7023link/p/6443225.html

            var bar = new ToolbarItem("\uf013", "", () =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    //DisplayAlert("提示", "抱歉,功能稍后开放...", "取消");
                });
            });

            ToolbarItems.Add(bar);

            //DependencyService.Get<IToolbarItemBadgeService>().SetBadge(this, MapSetting, "3", Color.Red, Color.White);
            //108.941338,34.364438

            map.ShowCompass = true;
            map.IsVisible   = true;
            map.Loaded     += Map_Loaded;
        }
Exemple #7
0
        public UpdatePage()
        {
            InitializeComponent();

            CustomNavigationPage.SetTitleIcon(this, "icon.png");
            CustomNavigationPage.SetHasNavigationBar(this, true);
            CustomNavigationPage.SetHasBackButton(this, true);

            CustomNavigationPage.SetTitleMargin(this, new Thickness(0, 0, 5, 0));
            CustomNavigationPage.SetTitleColor(this, Color.White);
            CustomNavigationPage.SetSubtitleColor(this, Color.White);
            CustomNavigationPage.SetTitlePosition(this, CustomNavigationPage.TitleAlignment.Start);
            CustomNavigationPage.SetTitleFont(this, Font.SystemFontOfSize(NamedSize.Large));
            CustomNavigationPage.SetHasShadow(this, true);
            CustomNavigationPage.SetTitlePadding(this, new Thickness(0, 0, 0, 0));
            //渐变从左到右
            CustomNavigationPage.SetGradientColors(this, new Tuple <Color, Color>(Color.FromHex("#5178bd"), Color.FromHex("#7fadf7")));
            CustomNavigationPage.SetGradientDirection(this, CustomNavigationPage.GradientDirection.RightToLeft);
        }
Exemple #8
0
        public void AddPage(Page page, string title)
        {
            var navigationPage = new CustomNavigationPage(page)
            {
                Title = title,
                Icon  = GetIconForPage(page)
            };

            if (page is BookingPage || page is ReportIncidentPage)
            {
                navigationPage.IsEnabled = Settings.CurrentBookingId != 0;
            }

            if (_previousPage == null)
            {
                _previousPage = page;
            }

            Children.Add(navigationPage);
        }
        public TraditionViewCard()
        {
            InitializeComponent();

            CustomNavigationPage.SetTitleIcon(this, "icon.png");
            CustomNavigationPage.SetHasNavigationBar(this, true);
            CustomNavigationPage.SetHasBackButton(this, true);

            CustomNavigationPage.SetTitleMargin(this, new Thickness(0, 0, 5, 0));
            CustomNavigationPage.SetTitleColor(this, Color.White);
            CustomNavigationPage.SetSubtitleColor(this, Color.White);
            CustomNavigationPage.SetTitlePosition(this, CustomNavigationPage.TitleAlignment.Start);
            CustomNavigationPage.SetTitleFont(this, Font.SystemFontOfSize(NamedSize.Large));
            CustomNavigationPage.SetHasShadow(this, true);
            CustomNavigationPage.SetTitlePadding(this, new Thickness(0, 0, 0, 0));
            //渐变从左到右
            CustomNavigationPage.SetGradientColors(this, new Tuple <Color, Color>(Color.FromHex("#5178bd"), Color.FromHex("#7fadf7")));
            CustomNavigationPage.SetGradientDirection(this, CustomNavigationPage.GradientDirection.RightToLeft);

            //this.ProductListView.BindingContext = new List<string>() { "1", "2", "3", "4" };
        }
        public Tradition_Card_Page2()
        {
            Title = "添加传统终端普查-经营信息";
            InitializeComponent();

            CustomNavigationPage.SetTitleIcon(this, "icon.png");
            CustomNavigationPage.SetHasNavigationBar(this, true);
            CustomNavigationPage.SetHasBackButton(this, true);

            CustomNavigationPage.SetTitleMargin(this, new Thickness(0, 0, 5, 0));
            CustomNavigationPage.SetTitleColor(this, Color.White);
            CustomNavigationPage.SetSubtitleColor(this, Color.White);
            CustomNavigationPage.SetTitlePosition(this, CustomNavigationPage.TitleAlignment.Start);
            CustomNavigationPage.SetTitleFont(this, Font.SystemFontOfSize(NamedSize.Large));
            CustomNavigationPage.SetHasShadow(this, true);
            CustomNavigationPage.SetTitlePadding(this, new Thickness(0, 0, 0, 0));
            //渐变从左到右
            CustomNavigationPage.SetGradientColors(this, new Tuple <Color, Color>(Color.FromHex("#5178bd"), Color.FromHex("#7fadf7")));
            CustomNavigationPage.SetGradientDirection(this, CustomNavigationPage.GradientDirection.RightToLeft);

            ModeOfCooperation.SelectedIndex = ModeOfCooperation.ItemsSource.Count - 1;
        }
        public Restaurant_Card_Page3()
        {
            Title = "添加餐饮终端普查-合作信息";
            InitializeComponent();

            CustomNavigationPage.SetTitleIcon(this, "icon.png");
            CustomNavigationPage.SetHasNavigationBar(this, true);
            CustomNavigationPage.SetHasBackButton(this, true);

            CustomNavigationPage.SetTitleMargin(this, new Thickness(0, 0, 5, 0));
            CustomNavigationPage.SetTitleColor(this, Color.White);
            CustomNavigationPage.SetSubtitleColor(this, Color.White);
            CustomNavigationPage.SetTitlePosition(this, CustomNavigationPage.TitleAlignment.Start);
            CustomNavigationPage.SetTitleFont(this, Font.SystemFontOfSize(NamedSize.Large));
            CustomNavigationPage.SetHasShadow(this, true);
            CustomNavigationPage.SetTitlePadding(this, new Thickness(0, 0, 0, 0));
            //渐变从左到右
            CustomNavigationPage.SetGradientColors(this, new Tuple <Color, Color>(Color.FromHex("#5178bd"), Color.FromHex("#7fadf7")));
            CustomNavigationPage.SetGradientDirection(this, CustomNavigationPage.GradientDirection.RightToLeft);


            this.ContextDemoList.Effects.Add(Effect.Resolve($"MyCensus.ListViewHighlightEffect"));
        }
Exemple #12
0
        public MainPage()
        {
            InitializeComponent();

            /*
             * Unity.Exceptions.ResolutionFailedException: Resolution of the dependency failed, type = 'System.Object', name = 'MainPage'.
             * Exception occurred while: Calling constructor MyCensus.Views.MainPage().
             * Exception is: ArgumentNullException - Value cannot be null.
             * Parameter name: activated
             * -----------------------------------------------
             * At the time of the exception, the container was:
             * Resolving MyCensus.Views.MainPage,MainPage (mapped from System.Object, MainPage)
             * Calling constructor MyCensus.Views.MainPage()
             *
             *
             * Unhandled Exception:
             *
             * Unity.Exceptions.ResolutionFailedException: Resolution of the dependency failed, type = 'System.Object', name = 'MainPage'.
             * Exception occurred while: Calling constructor MyCensus.Views.MainPage().
             * Exception is: ArgumentNullException - Value cannot be null.
             * Parameter name: activated
             * -----------------------------------------------
             * At the time of the exception, the container was:
             * Resolving MyCensus.Views.MainPage,MainPage (mapped from System.Object, MainPage)
             * Calling constructor MyCensus.Views.MainPage()
             * 出现了
             */

            try
            {
                CustomNavigationPage.SetTitleIcon(this, "icon.png");
                CustomNavigationPage.SetHasNavigationBar(this, true);
                CustomNavigationPage.SetHasBackButton(this, false);

                CustomNavigationPage.SetTitleMargin(this, new Thickness(0, 0, 5, 0));
                CustomNavigationPage.SetTitleColor(this, Color.White);
                CustomNavigationPage.SetSubtitleColor(this, Color.White);
                CustomNavigationPage.SetTitlePosition(this, CustomNavigationPage.TitleAlignment.Start);
                CustomNavigationPage.SetTitleFont(this, Font.SystemFontOfSize(NamedSize.Large));
                CustomNavigationPage.SetHasShadow(this, true);
                CustomNavigationPage.SetTitlePadding(this, new Thickness(0, 0, 0, 0));
                //渐变从左到右
                CustomNavigationPage.SetGradientColors(this, new Tuple <Color, Color>(Color.FromHex("#5178bd"), Color.FromHex("#7fadf7")));
                CustomNavigationPage.SetGradientDirection(this, CustomNavigationPage.GradientDirection.RightToLeft);

                this.CurrentPageChanged += Tabs_CurrentPageChanged;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Print(ex.Message);
            }

            //MessagingCenter.Unsubscribe<Tradition_Card_Page3ViewModel, string>(this, "page");
            //MessagingCenter.Subscribe<Tradition_Card_Page3ViewModel, string>(this, "page", (arg1, arg2) => {
            //    DisplayAlert("提示",""+ arg2, "Ok");
            //});
            //if (tab != 0)
            //    DisplayAlert("提示", "" + tab, "Ok");

            this.Children.Add(new HomePage()
            {
                Title = "首页",
                Icon  = "fa-home"
            });

            this.Children.Add(new SiteMap()
            {
                Title = "位置",
                Icon  = "fa-map-marker"
            });

            this.Children.Add(new MyTask()
            {
                Title = "任务",
                Icon  = "fa-windows"
            });

            this.Children.Add(new Networks()
            {
                Title = "网点",
                Icon  = "fa-bullseye"
            });

            this.Children.Add(new MenuPage()
            {
                Title = "我",
                Icon  = "fa-user"
            });

            //int indextab = 0;

            //var pages = Children.GetEnumerator();
            //pages.MoveNext(); // First page
            //pages.MoveNext(); // Second page
            //pages.MoveNext(); // Second page
            //CurrentPage = pages.Current;

            //TabbedPage tp = new TabbedPage();
            //tp.Children.Add(new PageFriends());
            //tp.Children.Add(new PageSnap());
            //tp.Children.Add(new PageNotes());
            //tp.CurrentPage = tp.Children[1];


            //MessagingCenter.Subscribe<NavigationMessage>(this, "tabpage", (args) => {
            //    //DisplayAlert("提示", "" + args.Paremeter, "Ok");
            //    //Tabs_PagesChanged(null,null);
            //    //this.SelectedItem = new Networks()
            //    //{
            //    //    Title = "网点",
            //    //    Icon = "fa-bullseye"
            //    //};
            //    //MessagingCenter.Unsubscribe<NavigationMessage>(this, "tabpage");
            //});

            //
            //if (indextab != 0)
            //    CurrentPage = Children[3];
        }