public StackLayout GetSubView(StudentDetails stdData)
        {
            ImageCircle imgStdPic = new ImageCircle()
            {
                HeightRequest     = 90,
                WidthRequest      = 90,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions   = LayoutOptions.CenterAndExpand
            };

            try
            {
                imgStdPic.Source = ImageSource.FromFile(stdData.stdImage);
            }
            catch (Exception ex)
            {
                var msg = ex.Message;
            }
            Label lblStdName = new Label()
            {
                Text      = stdData.stdName,
                TextColor = Color.Black,
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment   = TextAlignment.Start,
                HorizontalOptions       = LayoutOptions.CenterAndExpand,
                VerticalOptions         = LayoutOptions.CenterAndExpand
            };
            TapGestureRecognizer tapStdSelected = new TapGestureRecognizer();

            tapStdSelected.NumberOfTapsRequired = 1;
            tapStdSelected.Tapped += (sender, e) =>
            {
                try
                {
                    App.stdntDetails = stdData;
                    //App.Current.MainPage = new HomeStudentCarousel(stdData);
                    App.Current.MainPage = new StudentHomeMaster();
                }
                catch (Exception ex)
                {
                    var msg = ex.Message;
                }
            };
            imgStdPic.GestureRecognizers.Add(tapStdSelected);
            lblStdName.GestureRecognizers.Add(tapStdSelected);
            StackLayout stackStdholder = new StackLayout()
            {
                Children      = { imgStdPic, lblStdName },
                HeightRequest = (App.screenHeight * 33) / 100,
                WidthRequest  = (App.screenWidth * 33) / 100
            };

            return(stackStdholder);
        }
Exemplo n.º 2
0
        public StudentProfile(string imgHead, StudentDetails selectedStdnt)
        {
            selectedStdnt1 = new StudentDetails()
            {
                stdName = "SivaPrasad", stdImage = "UserProfile.png", stdClass = "IV", stdRollNo = "09A91A0152", stdMobile = "9988776655", stdEmail = "*****@*****.**", stdAddress = "B-6, M.J.Manzil, Ashapura Colony, Rajampeta, Tirupahi, Cuddapah."
            };

            if (imgHead == "imgHomeIcon.png")
            {
                isFromHome = true;
            }
            else
            {
                isFromHome = false;
            }
            InitializeComponent();
            //BackgroundImage = "SplashScreen.png";
            pageTitle.Text = Constants.SchoolName;
            //pageTitle.TextColor = AppGlobalVariables.orange;

            //var gridBodyHeight = (App.screenHeight * 40) / 100;
            //var gridBodyWidth = ((App.screenWidth * 1) / 100) - 40;
            //gridDataHolder.HeightRequest = gridBodyHeight;
            //gridDataHolder.WidthRequest = gridBodyWidth;
            //slider.Maximum = 100;//(App.screenWidth) - 40;//1000;//working
            ////slider.Maximum = (App.screenHeight * 40) / 100;//1000;//working
            //slider.Minimum = 0;
            //slider.Value = 0;
            //btnBorder.HeightRequest = gridBodyHeight - 68.7;
            //btnBorder.WidthRequest = gridBodyWidth - 8;
            //imgHeader.Source = ImageSource.FromFile(imgHead);
            //imgHeader.Source = ImageSource.FromFile(imgHead);

            imgProfilePic.Source        = ImageSource.FromFile("UserProfile.png");
            imgProfilePic.HeightRequest = 150;
            imgProfilePic.WidthRequest  = 150;
            lblNameData.Text            = selectedStdnt1.stdName;    //"Grandhi Veera Venkata Satya Naga Rama Praveen";
            lblRollNoData.Text          = selectedStdnt1.stdRollNo;  //"09A91A0152";
            lblClassData.Text           = selectedStdnt1.stdClass;   //"IV";
            lblMobileData.Text          = selectedStdnt1.stdMobile;  //"9998887775";
            lblEmailData.Text           = selectedStdnt1.stdEmail;   //"*****@*****.**";
            lblAddressData.Text         = selectedStdnt1.stdAddress; //"B-6, M.J.Manzil, Ashapura Colony, Rajampeta, Tirupahi, Cuddapah.";
            //gridHeader.BackgroundColor = AppGlobalVariables.orange;
        }
Exemplo n.º 3
0
        public HomeStudentCarousel(StudentDetails selectedStdnt)
        {
            InitializeComponent();
            Title           = "";
            BackgroundImage = "BG.png";

            Children.Add(new StudentProfile("imgHomeIcon.png", selectedStdnt));
            Children.Add(new HomeStudent());

            /*
             * ObservableCollection<Details> collection = new ObservableCollection<Details>
             * {
             *  new Details{data= new HomeStudent_Page() },
             *  new Details{data= new HomeStudent_Profile()}
             * };
             * BackgroundColor = Color.FromHex("#FFFFFF");
             *
             *
             #region for declaring and inatialise carousel view
             * var carouseHeight = (App.screenHeight * 85) / 100;
             * carousel = new CarouselView()
             * {
             *  BackgroundColor = Color.Transparent,
             *  HeightRequest = carouseHeight,
             *  //HorizontalOptions = LayoutOptions.End
             *  VerticalOptions = LayoutOptions.End
             *
             * };
             * carousel.ItemTemplate = new DataTemplate(typeof(HomeStudentTemplate));
             * carousel.PositionSelected += pageChanged;
             #endregion
             *
             * carousel.ItemsSource = collection;
             * StackLayout carouselStack = new StackLayout()
             * {
             *  Children = { carousel },
             *  BackgroundColor = Color.Transparent,
             *  HorizontalOptions = LayoutOptions.FillAndExpand,
             *  VerticalOptions = LayoutOptions.CenterAndExpand
             * };
             *
             * //downstack.Children.Add(carousel);
             *
             * dotLayout = new DotButtonsLayout(collection.Count, Color.White, 11);
             *
             * foreach (DotButton dot in dotLayout.dots)
             * {
             *  dot.Clicked += dotClicked;
             * }
             *
             *
             * StackLayout dotStack = new StackLayout()
             * {
             *  BackgroundColor = Color.Transparent,
             *  HorizontalOptions = LayoutOptions.FillAndExpand,
             *  VerticalOptions = LayoutOptions.End
             * };
             * dotStack.Children.Add(dotLayout);
             *
             * var pageSpacing = (App.screenHeight * 4.322535211) / 100;//(screenHeight * 7.322535211) / 100;
             *
             * StackLayout stack = new StackLayout()
             * {
             *  //Children = { stackSkip, downstack, buttonstack },
             *  Children = { carouselStack, dotStack },
             *  Spacing = pageSpacing,
             *  //StartColor = Color.FromHex("#9bdcfd"),
             *  //EndColor = Color.FromHex("#1e9bde"),
             *  HorizontalOptions = LayoutOptions.FillAndExpand,
             *  VerticalOptions = LayoutOptions.FillAndExpand
             * };
             * //PageControlsStackLayout.Children.Add(stack);
             *
             * Content = stack;
             *
             * }
             * private void pageChanged(object sender, SelectedPositionChangedEventArgs e)
             * {
             * var position = (int)(e.SelectedPosition);
             * for (int i = 0; i < dotLayout.dots.Length; i++)
             * {
             *  if (position == i)
             *  {
             *      dotLayout.dots[i].Source = ImageSource.FromFile("dotViewSelected.png");
             *  }
             *  else
             *  {
             *      dotLayout.dots[i].Source = ImageSource.FromFile("dotViewUnselected.png");
             *  }
             * }
             * }
             *
             * private void dotClicked(object sender)
             * {
             * var button = (DotButton)sender;
             * int index = button.index;
             * carousel.Position = index;
             * }
             */
        }