Пример #1
0
        public ProfitPage()
        {
            InitializeComponent();

            ProfitViewModel pvm = ((App)Application.Current).ProfitVM;

            BindingContext = pvm;

            int hd = DependencyService.Get <IDisplaySize>().GetHeightDiP();

            AbsoluteLayout.SetLayoutBounds(SideMenuOverlay, new Rectangle(0, 0, 0.9, hd - 20));

            //Slide menu creating
            SlideMenu = ((App)Application.Current).SideMenu;

            //Toolbar taps
            TapGestureRecognizer ToolbarTap1 = new TapGestureRecognizer();

            ToolbarTap1.Tapped += (s, e) =>
            {
                this.ShowMenu();
            };
            Menu.GestureRecognizers.Add(ToolbarTap1);

            TapGestureRecognizer ToolbarTap2 = new TapGestureRecognizer();

            ToolbarTap2.Tapped += (s, e) =>
            {
                SearchPage sp = new SearchPage();
                Application.Current.MainPage.Navigation.PushAsync(sp);
            };
            Search.GestureRecognizers.Add(ToolbarTap2);

            //Tabs navigation
            TapGestureRecognizer TabTap1 = new TapGestureRecognizer();

            TabTap1.Tapped += (s, e) =>
            {
                QuarterlyArea.BackgroundColor = Color.FromHex("#2793F5");
                QuarterlyLabel.TextColor      = Color.White;
                MonthlyArea.BackgroundColor   = Color.Transparent;
                MonthlyLabel.TextColor        = Color.FromHex("#B3B3B3");
                WeeklyArea.BackgroundColor    = Color.Transparent;
                WeeklyLabel.TextColor         = Color.FromHex("#B3B3B3");

                pvm.ReportsPeriod = ProfitViewModel.Period.Quarterly;
            };
            QuarterlyArea.GestureRecognizers.Add(TabTap1);

            TapGestureRecognizer TabTap2 = new TapGestureRecognizer();

            TabTap2.Tapped += (s, e) =>
            {
                QuarterlyArea.BackgroundColor = Color.Transparent;
                QuarterlyLabel.TextColor      = Color.FromHex("#B3B3B3");
                MonthlyArea.BackgroundColor   = Color.FromHex("#2793F5");
                MonthlyLabel.TextColor        = Color.White;
                WeeklyArea.BackgroundColor    = Color.Transparent;
                WeeklyLabel.TextColor         = Color.FromHex("#B3B3B3");

                pvm.ReportsPeriod = ProfitViewModel.Period.Monthly;
            };
            MonthlyArea.GestureRecognizers.Add(TabTap2);

            TapGestureRecognizer TabTap3 = new TapGestureRecognizer();

            TabTap3.Tapped += (s, e) =>
            {
                QuarterlyArea.BackgroundColor = Color.Transparent;
                QuarterlyLabel.TextColor      = Color.FromHex("#B3B3B3");
                MonthlyArea.BackgroundColor   = Color.Transparent;
                MonthlyLabel.TextColor        = Color.FromHex("#B3B3B3");
                WeeklyArea.BackgroundColor    = Color.FromHex("#2793F5");
                WeeklyLabel.TextColor         = Color.White;

                pvm.ReportsPeriod = ProfitViewModel.Period.Quarterly;
            };
            WeeklyLabel.GestureRecognizers.Add(TabTap3);

            TapGestureRecognizer TabTap4 = new TapGestureRecognizer();

            TabTap4.Tapped += (s, e) =>
            {
                Year1.TextColor = Color.FromHex("#2793F5");
                Year2.TextColor = Color.FromHex("#B3B3B3");

                pvm.Year = 2013;
            };
            Year1.GestureRecognizers.Add(TabTap4);

            TapGestureRecognizer TabTap5 = new TapGestureRecognizer();

            TabTap5.Tapped += (s, e) =>
            {
                Year1.TextColor = Color.FromHex("#B3B3B3");
                Year2.TextColor = Color.FromHex("#2793F5");

                pvm.Year = 2014;
            };
            Year2.GestureRecognizers.Add(TabTap5);

            TapGestureRecognizer TabTap6 = new TapGestureRecognizer();

            TabTap6.Tapped += (s, e) =>
            {
                PaidStatsLabel.TextColor = Color.FromHex("#2793F5");
                AllStatsLabel.TextColor  = Color.FromHex("#B3B3B3");
            };
            PaidStatsLabel.GestureRecognizers.Add(TabTap6);

            TapGestureRecognizer TabTap7 = new TapGestureRecognizer();

            TabTap7.Tapped += (s, e) =>
            {
                PaidStatsLabel.TextColor = Color.FromHex("#B3B3B3");
                AllStatsLabel.TextColor  = Color.FromHex("#2793F5");
            };
            AllStatsLabel.GestureRecognizers.Add(TabTap7);

            IncomeIcon.Source  = ImageSource.FromResource("Tulsi.Images.greenprofiticon.png");
            ExpenseIcon.Source = ImageSource.FromResource("Tulsi.Images.orangeprofiticon.png");
            LossIcon.Source    = ImageSource.FromResource("Tulsi.Images.grayprofiticon.png");

            SfChart chart = new SfChart();

            chart.BackgroundColor = Color.FromHex("#F3F3F3");
            //Initializing Primary Axis
            CategoryAxis primaryAxis = new CategoryAxis();

            primaryAxis.IsVisible = false;
            chart.PrimaryAxis     = primaryAxis;

            //Initializing Secondary Axis
            NumericalAxis secondaryAxis = new NumericalAxis();

            secondaryAxis.Minimum  = 400;
            secondaryAxis.Maximum  = 440;
            secondaryAxis.Interval = 20;

            chart.SecondaryAxis = secondaryAxis;

            //Initializing column series
            AreaSeries series = new AreaSeries();

            series.SetBinding(ChartSeries.ItemsSourceProperty, "ChartData");
            series.XBindingPath = "Step";
            series.YBindingPath = "Value";
            series.Color        = Color.FromHex("#A9D4FB");
            series.StrokeColor  = Color.FromHex("#2793F5");

            chart.Series.Add(series);
            ChartGrid.Children.Add(chart);
            Grid.SetColumn(chart, 1);
        }
Пример #2
0
        public BuyerPage()
        {
            InitializeComponent();

            DashboardViewModel dvm = new DashboardViewModel();

            BindingContext = dvm;


            int hd = DependencyService.Get <IDisplaySize>().GetHeightDiP();

            AbsoluteLayout.SetLayoutBounds(SideMenuOverlay, new Rectangle(0, 0, 0.9, hd - 20));

            SfChart        chart          = new SfChart();
            DoughnutSeries doughnutSeries = new DoughnutSeries()
            {
                ItemsSource         = dvm.ChartData,
                XBindingPath        = "Name",
                YBindingPath        = "Value",
                DoughnutCoefficient = 0.7,
                ExplodeIndex        = 0
            };
            List <Color> colors = new List <Color>()
            {
                Color.FromHex("#82DA69"),
                Color.FromHex("#E47132"),
                Color.FromHex("#9EE5FC"),
            };

            doughnutSeries.ColorModel.Palette       = ChartColorPalette.Custom;
            doughnutSeries.ColorModel.CustomBrushes = colors;
            chart.WidthRequest  = 180;
            chart.HeightRequest = 180;
            //chart.BackgroundColor = Color.FromHex("#F3F3F3");
            chart.Series.Add(doughnutSeries);

            chart.Title.TextColor   = Color.FromHex("#cccccc");
            chart.HorizontalOptions = LayoutOptions.Center;
            chart.VerticalOptions   = LayoutOptions.Center;
            ChartGrid.Children.Add(chart);

            StackLayout MiddleStack = new StackLayout()
            {
                VerticalOptions   = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center,
                BackgroundColor   = Color.White
            };
            Label MiddleText1 = new Label()
            {
                Text           = "23%",
                FontSize       = 20,
                FontAttributes = FontAttributes.Bold
            };
            Label MiddleText2 = new Label()
            {
                Text           = "mobile",
                FontSize       = 10,
                FontAttributes = FontAttributes.Bold
            };

            MiddleStack.Children.Add(MiddleText1);
            MiddleStack.Children.Add(MiddleText2);
            ChartGrid.Children.Add(MiddleStack);

            BuyerViewModel bvm = new BuyerViewModel();

            this.BindingContext = bvm;
            TransactionsListView.ItemsSource = bvm.TransactionsData;

            //Slide menu creating
            SlideMenu = ((App)Application.Current).SideMenu;

            //Toolbar taps
            TapGestureRecognizer ToolbarTap1 = new TapGestureRecognizer();

            ToolbarTap1.Tapped += (s, e) =>
            {
                this.ShowMenu();
            };
            Menu.GestureRecognizers.Add(ToolbarTap1);

            TapGestureRecognizer ToolbarTap2 = new TapGestureRecognizer();

            ToolbarTap2.Tapped += (s, e) =>
            {
                SearchPage sp = new SearchPage();
                Application.Current.MainPage.Navigation.PushAsync(sp);
            };
            Search.GestureRecognizers.Add(ToolbarTap2);

            //In page navigation

            TapGestureRecognizer InPageNavigationTap2 = new TapGestureRecognizer();

            InPageNavigationTap2.Tapped += (s, e) =>
            {
                BuyerRankingsPage brp = new BuyerRankingsPage();
                Application.Current.MainPage.Navigation.PushAsync(brp);
            };
            Ranks.GestureRecognizers.Add(InPageNavigationTap2);
            RanksLabel.GestureRecognizers.Add(InPageNavigationTap2);

            TapGestureRecognizer InPageNavigationTap3 = new TapGestureRecognizer();

            InPageNavigationTap3.Tapped += (s, e) =>
            {
                LatePaymentsPage lpp = new LatePaymentsPage();
                Application.Current.MainPage.Navigation.PushAsync(lpp);
            };
            LatePayments.GestureRecognizers.Add(InPageNavigationTap3);
            LatePaymentsLabel.GestureRecognizers.Add(InPageNavigationTap3);
            RanksLabel.GestureRecognizers.Add(InPageNavigationTap2);
        }
Пример #3
0
        public ArrivalPage()
        {
            InitializeComponent();

            int hd = DependencyService.Get <IDisplaySize>().GetHeightDiP();

            AbsoluteLayout.SetLayoutBounds(SideMenuOverlay, new Rectangle(0, 0, 0.9, hd - 20));

            CalendarArea.Source = ImageSource.FromResource("Tulsi.Images.calendar_background.png");
            DatesArea.Source    = ImageSource.FromResource("Tulsi.Images.dates_background.png");
            c1.Source           = ImageSource.FromResource("Tulsi.Images.datesbluecircle.png");
            c2.Source           = ImageSource.FromResource("Tulsi.Images.datesbluecircle.png");
            c3.Source           = ImageSource.FromResource("Tulsi.Images.datesbluecircle.png");

            cg.Source  = ImageSource.FromResource("Tulsi.Images.greencircle.png");
            cp1.Source = ImageSource.FromResource("Tulsi.Images.purplecircle.png");
            cp2.Source = ImageSource.FromResource("Tulsi.Images.purplecircle.png");
            cp3.Source = ImageSource.FromResource("Tulsi.Images.purplecircle.png");

            //Calendar initialization
            ArrivalCalendar.DatesBackgroundColor = Color.FromHex("#F3F3F3");
            ArrivalCalendar.DatesFontSize        = 12;
            ArrivalCalendar.WeekdaysFontSize     = 12;
            ArrivalCalendar.BorderWidth          = 0;
            ArrivalCalendar.DisabledBorderWidth  = 0;
            ArrivalCalendar.OuterBorderWidth     = 0;
            ArrivalCalendar.SelectedBorderWidth  = 1;
            ArrivalCalendar.WeekdaysShow         = false;

            List <SpecialDate> Dates  = new List <SpecialDate>();
            SpecialDate        event1 = new SpecialDate(new DateTime(2017, 1, 24));

            event1.BackgroundColor = Color.FromHex("#82DA69");
            event1.Selectable      = true;

            SpecialDate event2 = new SpecialDate(new DateTime(2017, 1, 26));

            event2.BackgroundColor = Color.FromHex("#9E7AE6");
            event2.Selectable      = true;

            Dates.Add(event1);
            Dates.Add(event2);
            ArrivalCalendar.SpecialDates = Dates;
            ArrivalCalendar.DateClicked += ArrivalCalendar_DateClicked;


            //Slide menu creating
            SlideMenu = ((App)Application.Current).SideMenu;

            //Toolbar taps
            TapGestureRecognizer ToolbarTap1 = new TapGestureRecognizer();

            ToolbarTap1.Tapped += (s, e) =>
            {
                this.ShowMenu();
            };
            Menu.GestureRecognizers.Add(ToolbarTap1);

            TapGestureRecognizer ToolbarTap2 = new TapGestureRecognizer();

            ToolbarTap2.Tapped += (s, e) =>
            {
                SearchPage sp = new SearchPage();
                Application.Current.MainPage.Navigation.PushAsync(sp);
            };
            Search.GestureRecognizers.Add(ToolbarTap2);

            //In page navigation
            TapGestureRecognizer InPageNavigationTap1 = new TapGestureRecognizer();

            InPageNavigationTap1.Tapped += (s, e) =>
            {
                ArrivalDetailsPage adp = new ArrivalDetailsPage();
                Application.Current.MainPage.Navigation.PushAsync(adp);
            };
            DateArrivalsList.GestureRecognizers.Add(InPageNavigationTap1);
        }