コード例 #1
0
        /// <summary>
        /// ctor().
        /// </summary>
        public GrowerView()
        {
            InitializeComponent();

            BindingContext = _viewModel = new GrowerViewModel();

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

            doughnutSeries.ColorModel.Palette       = ChartColorPalette.Custom;
            doughnutSeries.ColorModel.CustomBrushes = colors;
            chart.Series.Add(doughnutSeries);

            chart.HorizontalOptions = LayoutOptions.Center;
            chart.VerticalOptions   = LayoutOptions.StartAndExpand;
            chart.WidthRequest      = 180;
            chart.HeightRequest     = 180;
            //chart.BackgroundColor = Color.FromHex("#F3F3F3");
            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);
        }
コード例 #2
0
        public App()
        {
            InitializeComponent();

            //ViewModels
            AuditLogVM            = new AuditLogViewModel();
            BuyerVM               = new BuyerViewModel();
            BuyerRankingsVM       = new BuyerRankingsViewModel();
            DashboardVM           = new DashboardViewModel();
            ExpensesVM            = new ExpensesViewModel();
            GrowerVM              = new GrowerViewModel();
            LadaanVM              = new LadaanViewModel();
            LatePaymentsVM        = new LatePaymentsViewModel();
            ProfileVM             = new ProfileViewModel();
            ProfitVM              = new ProfitViewModel();
            SearchVM              = new SearchViewModel();
            StockPendingDetailsVM = new StockPendingDetailsViewModel();
            TodayRatesVM          = new TodayRatesViewModel();

            //Menu
            SideMenu = new SideMenuView();

            /*LoginPage lp = new LoginPage();
             * DashboardPage dp = new DashboardPage();
             * PasswordRecoveryPage prp = new PasswordRecoveryPage();
             * PasscodePage pcp = new PasscodePage();
             * LadaanPage lap = new LadaanPage();
             * TodayRatesPage trp = new TodayRatesPage();
             * ChatPage cp = new ChatPage();
             * ProfitPage pp = new ProfitPage();
             * ExpensesListPage ep = new ExpensesListPage();
             * BankAccountsPage bp = new BankAccountsPage();
             * BankAccountDetailsPage bdp = new BankAccountDetailsPage();
             * ArrivalPage ap = new ArrivalPage();
             * ArrivalDetailsPage adp = new ArrivalDetailsPage();
             * GrowerProfilePage gpp = new GrowerProfilePage();
             * BuyerProfilePage bpp = new BuyerProfilePage();
             * LatePaymentsPage lpp = new LatePaymentsPage();
             * BuyerRankingsPage brp = new BuyerRankingsPage();
             * SearchPage sp = new SearchPage();
             * StockPendingPage spp = new StockPendingPage();
             * StockPendingDetailsPage spdp = new StockPendingDetailsPage();
             * SetupDashboardPage sdp = new SetupDashboardPage();
             * NewsPage np = new NewsPage();*/

            DashboardPage dp = new DashboardPage();
            LoginPage     lp = new LoginPage();

            MainPage = new NavigationPage(lp);
        }
コード例 #3
0
        public GrowerPage()
        {
            InitializeComponent();

            GrowerViewModel    gvm = new GrowerViewModel();
            DashboardViewModel dvm = new DashboardViewModel();

            BindingContext = dvm;

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

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

            BuyerViewModel bvm = new BuyerViewModel();

            this.BindingContext = bvm;
            TransactionsListView.ItemsSource   = bvm.TransactionsData;
            TransactionsListView.ItemSelected += (sender, e) =>
            {
                ((ListView)sender).SelectedItem = null;
            };

            //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
            TransactionsListView.ItemSelected += (sender, e) =>
            {
                GrowerProfilePage gpp = new GrowerProfilePage();
                Application.Current.MainPage.Navigation.PushAsync(gpp);
            };

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

            doughnutSeries.ColorModel.Palette       = ChartColorPalette.Custom;
            doughnutSeries.ColorModel.CustomBrushes = colors;
            chart.Series.Add(doughnutSeries);

            chart.HorizontalOptions = LayoutOptions.Center;
            chart.VerticalOptions   = LayoutOptions.StartAndExpand;
            chart.WidthRequest      = 180;
            chart.HeightRequest     = 180;
            //chart.BackgroundColor = Color.FromHex("#F3F3F3");
            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);

            TransactionsListView.ItemsSource   = gvm.TransactionsData;
            TransactionsListView.ItemSelected += (sender, e) =>
            {
                ((ListView)sender).SelectedItem = null;
            };
        }