示例#1
0
 public HistoryPage(RootPage parent)
 {
     InitializeComponent ();
     mParent = parent;
     MainStackLayout.Spacing = MyDevice.ViewPadding;
     SetGrid1Definitions ();
 }
示例#2
0
 public SettingsPage(RootPage parent)
 {
     InitializeComponent ();
     mParent = parent;
     NavigationPage.SetHasNavigationBar (this, false);
     InitializeLayout ();
 }
示例#3
0
		public AddAddressPage (AddressClass address, RootPage parent)
		{
			InitializeComponent ();
			mParent = parent;

			mAddressModel = address;

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

			if (address != null) {
				SetInitialTexts ();
				bNameTextChanged = true;
				bSurNameTextChanged = true;
				bAddressTextChanged = true;
				bRegionTextChanged = true;
				bAddressDescriptionTextChanged = true;
				bAdressLine3TextChanged = true;
				bTelephoneTextChanged = true;
				SetSubmitButton ();
			}

			EventHandlers ();
		}
示例#4
0
 public ReceiptView(RootPage parent, Object obj)
 {
     InitializeComponent ();
     mParent = parent;
     mObject = obj;
     mUserModel = mUserModel.GetUser ();
     NavigationPage.SetHasNavigationBar (this, false);
     InitializeLayout (obj);
 }
 public BrowseCategoriesPage(RootPage parent)
 {
     InitializeComponent ();
     mParent = parent;
     CategoryModel.PopulateCategories ();
     mCategories = CategoryModel.CategoryList;
     NavigationPage.SetHasNavigationBar (this, false);
     InitializeLayout ();
 }
示例#6
0
		public CartPage (RootPage parent)
		{
			InitializeComponent ();
			mParent = parent;
			mStackLayout = StackLayout1;
			NavigationPage.SetHasNavigationBar (this, false);

			SetGrid1Properties ();
			SetGrid2Properties ();
		}
示例#7
0
		public SearchPage (string searchString, string categoryId,RootPage parent)
		{
			mParent = parent;
			InitializeComponent ();
			mSearchString = searchString;
			NavigationPage.SetHasNavigationBar (this, false);
			mBoxViewList = new List<BoxView> ();
			mButtonList = new List<Label> ();
			//SetGrid1Definitions ();
			PopulateSearch (mParent.mBrowseProductPage);
			InitializeLayout ();
			MyDevice.currentPage = this;
		}
示例#8
0
        protected override void InitializeCell()
        {
            //	mUser = new UserClass ();
            mParent = MyDevice.rootPage;
            var mainRelativeLayout = new RelativeLayout(){
                Padding = 0,
                WidthRequest = MyDevice.GetScaledSize (630),
                HeightRequest = MyDevice.GetScaledSize (213),
            };
            categoryImage = new Image ()
            {
                WidthRequest = MyDevice.GetScaledSize (619),
                HeightRequest = MyDevice.GetScaledSize (202),
                /*CacheDuration = TimeSpan.FromDays(30),
                DownsampleToViewSize = true,
                RetryCount = 10,
                RetryDelay = 250,
                TransparencyEnabled = false,
                FadeAnimationEnabled = false,*/
            };
            //categoryImage.Success += (object sender, CachedImageEvents.SuccessEventArgs e) => {System.Diagnostics.Debug.WriteLine(category.CategoryImagePath);};

            var tapGestureRecognizer = new TapGestureRecognizer ();

            tapGestureRecognizer.Tapped +=async (sender, e) => {
                if(category.CategoryID == ReleaseConfig.TOBACCO_ID)
                {
                    var isOk = await mParent.DisplayAlert("Warning","I am over 20 years old and I know smoking is bad for my health.","AGREE","DISAGREE");
                    if(isOk)
                        mParent.LoadCategory(category);
                }else if(category.CategoryID == ReleaseConfig.FRUITS_ID||category.CategoryID == ReleaseConfig.MEAT_ID)
                {
                    await mParent.DisplayAlert("Please Remember","Delivered quantity might differ from the actual ordered quantity by ± 50 grams.","OK");

                    mParent.LoadCategory(category);
                }
                else
                    mParent.LoadCategory(category);
            };

            categoryImage.GestureRecognizers.Add (tapGestureRecognizer);

            mainRelativeLayout.Children.Add (categoryImage,
                Constraint.Constant (MyDevice.GetScaledSize(11)),
                Constraint.Constant (MyDevice.GetScaledSize(11))
            );

            this.View = mainRelativeLayout;
        }
示例#9
0
 private void SetRootPage()
 {
     if( mParent is BrowseProductsPage)
     {
         mRootPage = (mParent as BrowseProductsPage).mParent;
     }
     else if( mParent is FavoritesPage)
     {
         mRootPage = (mParent as FavoritesPage).mParent;
     }
     else if( mParent is SearchPage )
     {
         mRootPage = (mParent as SearchPage).mParent;
     }
 }
示例#10
0
		public FavoritesPage (RootPage parent)
		{					
			MyDevice.currentPage = this;
			InitializeComponent ();
			mParent = parent;
			PopulateProducts();
			CreationInitialization ();
		}
示例#11
0
        public CategoryCell(StackLayout parentGrid, Category category, RootPage parent = null)
        {
            mParent = parent;
            var mainRelativeLayout = new RelativeLayout(){
                Padding = 0
            };

            mCategory = category;
            mCategoryList = new List<Category> ();
            mProductDictionary = new Dictionary<string, List<Product>> ();
            mUser = new UserClass ();

            //System.Diagnostics.Debug.WriteLine (category.CategoryImagePath);

            CachedImage categoryImage = new CachedImage ()
            {
                WidthRequest = MyDevice.GetScaledSize (619),
                HeightRequest = MyDevice.GetScaledSize (202),
                Source = category.CategoryImagePath,//Source = category.CategoryImageName,
                CacheDuration = TimeSpan.FromDays(30),
                DownsampleToViewSize = true,
                RetryCount = 10,
                RetryDelay = 250,
                TransparencyEnabled = false,
                FadeAnimationEnabled = false,
            };
            categoryImage.Success += (object sender, CachedImageEvents.SuccessEventArgs e) => {System.Diagnostics.Debug.WriteLine("aq");};
                /*
            if( mParent.mFolder.CheckExistsAsync(ProductModel.mRootFolderPath + "/" + ParseConstants.IMAGE_FOLDER_NAME + "/" + category.CategoryImageName).Result != PCLStorage.ExistenceCheckResult.NotFound)
                categoryImage.Source = ProductModel.mRootFolderPath + "/" + ParseConstants.IMAGE_FOLDER_NAME + "/" + category.CategoryImageName;
            else
                categoryImage.Source = ImageSource.FromResource("bluemart.SavedImages."+category.CategoryImageName);
            */
            /*Label shadowCategoryText = new Label (){
                FontSize = MyDevice.FontSizeMedium,
                BackgroundColor = Color.Transparent,
                TextColor = Color.Black,
                FontAttributes = FontAttributes.Bold,
                Text = category.Name
            };

            Label categoryText = new Label (){
                FontSize = MyDevice.FontSizeMedium,
                BackgroundColor = Color.Transparent,
                TextColor = Color.White,
                Text = category.Name
            };
            */
            var tapGestureRecognizer = new TapGestureRecognizer ();

            tapGestureRecognizer.Tapped +=async (sender, e) => {
                if(category.CategoryID == ReleaseConfig.TOBACCO_ID)
                {
                    var isOk = await mParent.DisplayAlert("Warning","I am over 20 years old and I know smoking is bad for my health.","AGREE","DISAGREE");
                    if(isOk)
                        LoadProductsPage(category.CategoryID,parent);
            }else if(category.CategoryID == ReleaseConfig.FRUITS_ID||category.CategoryID == ReleaseConfig.MEAT_ID)
            {
                await mParent.DisplayAlert("Please Remember","Delivered quantity might differ from the actual ordered quantity by ± 50 grams.","OK");

                    LoadProductsPage(category.CategoryID,parent);
            }
                else
                    LoadProductsPage(category.CategoryID,parent);
            };

            categoryImage.GestureRecognizers.Add (tapGestureRecognizer);

            mainRelativeLayout.Children.Add (categoryImage,
                Constraint.Constant (MyDevice.GetScaledSize(11)),
                Constraint.Constant (MyDevice.GetScaledSize(11))
            );
            /*mainRelativeLayout.Children.Add (shadowCategoryText,
                Constraint.RelativeToView (categoryImage, (p, sibling) => {
                    return sibling.Bounds.Left + MyDevice.GetScaledSize (12);
                }),
                Constraint.RelativeToView (categoryImage, (p, sibling) => {
                    return sibling.Bounds.Bottom - MyDevice.GetScaledSize (45);
                })
            );
            mainRelativeLayout.Children.Add (categoryText,
                Constraint.RelativeToView (categoryImage, (p, sibling) => {
                    return sibling.Bounds.Left + MyDevice.GetScaledSize (12);
                }),
                Constraint.RelativeToView (categoryImage, (p, sibling) => {
                    return sibling.Bounds.Bottom - MyDevice.GetScaledSize (45);
                })
            );*/

            this.View = mainRelativeLayout;
        }
示例#12
0
 public void LoadProductsPage(string categoryID,RootPage parent)
 {
     PopulateProducts ();
     //PopulateProductsTest();
     parent.LoadProductsPage(mProductDictionary,mCategory);
 }
示例#13
0
        public MapView(RootPage parent, UserClass mUserModel)
        {
            this.mUserModel = mUserModel;
            InitializeComponent ();
            mParent = parent;
            NavigationPage.SetHasNavigationBar (this, false);

            //InitalizeMemberVariables ();
            pinDatas = new List<PinData>();
            /*pinDatas.Add (new PinData(25.082742, 55.147174,"bm_pin","Dubai Marina BlueMart"));
            pinDatas.Add (new PinData(25.099536, 55.178529,"bm_pin","Tecom BlueMart"));
            pinDatas.Add (new PinData(25.094988, 55.172659,"bm_pin","Greens BlueMart"));*/
            pinDatas.Add (new PinData(25.049560, 55.205282,"bm_pin","Blue Mart JVC"));
            var map = new ExtendedMap (new Position (25.20, 55.26), 20, pinDatas,this);

            /*var map = new Map(
                MapSpan.FromCenterAndRadius(
                    new Position(25.20,55.26), Distance.FromMiles(20))) {
                IsShowingUser = true,
                HeightRequest = 100,
                WidthRequest = 960,
                VerticalOptions = LayoutOptions.FillAndExpand
            };

            var position = new Position(25.082742, 55.147174);
            var pin = new Pin {
                Type = PinType.Place,
                Position = position,
                Label = "Blue Mart Supermarket",
                Address = "Dubai Marina, Dubai - UAE"
            };
            pin.Clicked += (object sender, EventArgs e) =>
            {
                OnPinClicked(0);
            };
            map.Pins.Add(pin);

            position = new Position(25.099536, 55.178529);
            pin = new Pin {
                Type = PinType.Place,
                Position = position,
                Label = "Blue Mart",
                Address = "Tecom, Dubai - UAE"
            };
            pin.Clicked += (object sender, EventArgs e) =>
            {
                OnPinClicked(1);
            };
            map.Pins.Add(pin);

            position = new Position(25.046035, 55.232205);
            pin = new Pin {
                Type = PinType.Place,
                Position = position,
                Label = "Blue Mart",
                Address = "Motor City, Dubai - UAE"
            };
            pin.Clicked += (object sender, EventArgs e) =>
            {
                OnPinClicked(2);
            };
            map.Pins.Add(pin);
            */
            StartShopingButton = new Button { Text = "Choose nearest bluemart" , BackgroundColor= Color.White, BorderWidth=0, TextColor = MyDevice.RedColor};
            StartShopingButton.Clicked += OnStartShopingButtonClicked;
            StartShopingButton.IsEnabled=false;

            Content = new StackLayout {
                Spacing = 0,
                Children = {
                    map,
                    StartShopingButton
                }};
        }