Exemplo n.º 1
0
        public App()
        {

            LocService = DependencyService.Get<HelperClasses.ILocationProvider>();
            page1 = new OurCrousalPage("CarousalPage1.jpg");
            page2 = new OurCrousalPage("CarousalPage2.jpg");
            page1.btnEntry.IsEnabled = false;
            page2.btnEntry.IsEnabled = false;
            counter = 0;
            carousal = new CarouselPage();
            carousal.Children.Add(page1);
            carousal.Children.Add(page2);

            fileService = DependencyService.Get<ISaveAndLoad>();

            page1.btnEntry.Clicked += delegate
            {

                MainPage = new NavigationPage(new HomePage())
                {
                    BarBackgroundColor = ZadSpecialDesigen.ZadGreenNavBar,
                    BarTextColor = Color.White,
                    Icon = "icon2.png",

                };

                page1 = null;
                page2 = null;
                carousal = null;
            };

            page2.btnEntry.Clicked += delegate
            {

                navigationPage = new NavigationPage(new HomePage())
                {
                    BarBackgroundColor = ZadSpecialDesigen.ZadGreenNavBar,
                    BarTextColor = Color.White,
                    Icon = "icon2.png",
                };
                MainPage = navigationPage;
                page1 = null;
                page2 = null;
                carousal = null;
            };


            MainPage = carousal;
            if (Device.OS == TargetPlatform.iOS)
            {
                var time = TimeSpan.FromSeconds(3);
                Device.StartTimer(time, Swapping);
            }

        }
Exemplo n.º 2
0
        private const double ClosePlacesDistanceInKM = 0.3;// set the circle of close area by km
        public BasicLayout()
        {
            // create the layout
            _layout = new Grid
            {
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand
                ,
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = new GridLength(100, GridUnitType.Star)
                    },
                }
            };
            Search = new SearchBar
            {
                Placeholder               = "البحث .."
                , TextColor               = ZadSpecialDesigen.ZadGreen
                , SearchCommand           = new Command(DoSearch)
                , BackgroundColor         = Color.White
                , PlaceholderColor        = ZadSpecialDesigen.ZadGreen
                , HorizontalTextAlignment = TextAlignment.End
            };



            var searchstack = new StackLayout
            {
                Padding = new Thickness(3, 7, 3, 0)
            };

            MainForAdjDataView = new StackLayout
            {
                BackgroundColor = ZadSpecialDesigen.ZadWhite
                ,
                Padding = 0
            };
            ////////////////////////////////////////////////////
            MainBodyScrollView = new ScrollView();
            searchstack.Children.Add(Search);
            MainForAdjDataView.Children.Add(searchstack);
            MainForAdjDataView.Children.Add(MainBodyScrollView);

            this.ToolbarItems.Add(new ToolbarItem("Z", "bookmark_icon.png", ViewFavoriteListInPage, ToolbarItemOrder.Primary, 1));
            this.ToolbarItems.Add(new ToolbarItem("S", "humburger.png", AnimatePanel, ToolbarItemOrder.Primary, 2));
            if (Device.OS == TargetPlatform.Android)
            {
                this.PlacesNearByMe = new ToolbarItem("P", "bell_blank_red", ViewTheDistancePage, 0);
            }
            else
            {
                this.PlacesNearByMe = new ToolbarItem("P", "bell_with_point", ViewTheDistancePage, 0);
            }
            this.noPlacesorDisablePlaces = new ToolbarItem("Pl", "bell_icon", doNothing, 0);
            _layout.Children.Add(MainForAdjDataView, 0, 0);
            this.Disappearing += (o, e) =>
            {
                try {
                    _layout.Children.Remove(_panel);
                }
                catch (Exception)
                {
                }
            };
            CreatePanel();
            location     = DependencyService.Get <HelperClasses.ILocationProvider>();
            this.Content = _layout;
        }