protected override void OnAppearing()
        {
            base.OnAppearing();
            Title = League.Text;
            StartTimer();

            Insights.Track(InsightsConstants.LeagueResultsPage);

            cts = new CancellationTokenSource();
            _fixturesListView.ItemAppearing += _fixturesListView_ItemAppearing;
            _fixturesListView.ItemTapped    += _fixturesListView_ItemTapped;
            _fixturesListView.Refreshing    += _fixturesListView_Refreshing;
            _mainNoDataLayout.Refreshing    += _fixturesListView_Refreshing;

            if (absoluteAndroid != null)
            {
                if ((Content as AbsoluteLayout).Children[0] != _fixturesListView)
                {
                    _fixturesListView.BeginRefresh();
                }
                return;
            }

            if (Content != _fixturesListView)
            {
                _fixturesListView.BeginRefresh();
            }
        }
Example #2
0
 /// <summary>
 /// Método que realiza lo necesario para añadir el chart creado al listView
 /// </summary>
 private void OnChartCreated()
 {
     UpdateLayout();
     NavigateTo(_master.GetNavigationPage, chartService.Charts[chartService.Charts.Count - 1].ChartPage);
     lView.BeginRefresh();
     lView.EndRefresh();
 }
        protected override void OnAppearing()
        {
            base.OnAppearing();

            /*
             *          var searchBarView = new SearchBarView ();
             *          searchBarView.Clear += OnSearchClear;
             *          searchBarView.Search += OnSearch;
             */

            _listWrapper = new ExhibitorsListWrapper();

            ExhibitorsWrapper = AppModel.Instance.ExhibitorsWrapper;

            /*
             * if (ExhibitorsWrapper == null)
             * {
             *  AppModel.Instance.SponsorTypes.UpdateData(LocalData.getLocalSponsorList());
             *  AppModel.Instance.Exhibitors.UpdateData(LocalData.getLocalExhibitorList());
             *  ExhibitorsWrapper = new ExhibitorsDataWrapper(AppModel.Instance.SponsorTypes, AppModel.Instance.Exhibitors, false);
             * }*/
            _groupListView = new ListView {
                HasUnevenRows       = false,
                RowHeight           = 60,
                IsGroupingEnabled   = true,
                GroupHeaderTemplate = new DataTemplate(typeof(ExhibitorGroupItem)),
                SeparatorVisibility = SeparatorVisibility.None,
                ItemTemplate        = new DataTemplate(typeof(ExhibitorViewCell)),

                RefreshCommand         = _listWrapper.RefreshCommand,
                IsPullToRefreshEnabled = true,
                ItemsSource            = ExhibitorsWrapper,
                BindingContext         = _listWrapper
            };
            _groupListView.SetBinding <ExhibitorsListWrapper> (ListView.IsRefreshingProperty, vm => vm.IsBusy, BindingMode.OneWay);

            var layout = new StackLayout
            {
                Padding  = new Thickness(20),
                Children = { _groupListView }
                //Children = {searchBarView, _groupListView}
            };

            BGLayoutView bgLayout = new BGLayoutView(AppResources.DefaultBgImage, layout, false, true);

            Content = bgLayout;

            _groupListView.BeginRefresh();



            _groupListView.BeginRefresh();
        }
Example #4
0
		public ProductPage (String uid)
		{
			Title = "Produits";
			var dataTemplate = new DataTemplate (typeof(TextCell));
			dataTemplate.SetBinding (TextCell.TextProperty, "name");
			dataTemplate.SetBinding (TextCell.DetailProperty, "price");

			list = new ListView ();
			list.ItemTemplate = dataTemplate;
			list.IsPullToRefreshEnabled = true;
			list.RefreshCommand = new Command (() => loadProductData());

			list.ItemSelected += (object sender, SelectedItemChangedEventArgs e) => {
				if(e.SelectedItem == null)
					return;
				Product product = (Product)e.SelectedItem;
				list.SelectedItem = null;
				//TODO: implement nav to product detail page
				//this.Navigation.PushAsync (new ProductPage(category.uid));
			};

			Content = list;
			this.categoryUid = uid;
			list.BeginRefresh ();
		}
Example #5
0
        private async Task ShowProjectForm()
        {
            DictModel dict = await OverlayForm(projectForm);

            try {
                if (dict != null)
                {
                    await App.CreateProject(dict.s("title"));

                    list.BeginRefresh();
                }
            } catch (Exception ex) {
                Debug.WriteLine(ex.ToString());
                await DisplayAlert("Error creating project", ex.Message, "OK");
            }
        }
        private void SearchBar_OnTextChanged(object sender, TextChangedEventArgs e)
        {
            int  number;
            bool isNumeric = int.TryParse(e.NewTextValue, out number);

            if (isNumeric)
            {
                listView.BeginRefresh();

                if (string.IsNullOrWhiteSpace(e.NewTextValue))
                {
                    listView.ItemsSource = this.repositoryList.books;
                }
                else
                {
                    listView.ItemsSource = this.repositoryList.books.Where(i => i.client.identification == (number));
                }

                listView.EndRefresh();
            }
            else
            {
                listView.ItemsSource = this.repositoryList.books;
            }
        }
Example #7
0
        public static void set_data2(BMSong song)
        {
            name.Text    = song.SongName;
            artist.Text  = song.artist;
            creator.Text = "Difficulties :";
            List <BMDifficulty> bmdiff = new List <BMDifficulty>();

            foreach (BMDifficulty diff in song.difficulty)
            {
                string path     = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
                string filename = "scores";
                string dbPath   = Path.Combine(path, filename);
                Ini    ini      = new Ini(dbPath);

                int last_score = int.Parse(ini.GetValue(diff.bmid.ToString(), "score", "0"));
                int last_combo = int.Parse(ini.GetValue(diff.bmid.ToString(), "maxmm", "0"));
                int last_acc   = (int)float.Parse(ini.GetValue(diff.bmid.ToString(), "acc", "0"), new CultureInfo("en-US"));

                BMDifficulty newdiff = new BMDifficulty(diff.path, diff.difficulty, diff.highscore, diff.acc, diff.bmid);
                newdiff.liststring  = "Score : " + last_score;
                newdiff.liststring2 = "Combo : " + last_combo;
                bmdiff.Add(newdiff);
            }

            lstview.BeginRefresh();
            lstview.ItemsSource = bmdiff;
            lstview.EndRefresh();
            lstview.SelectedItem = bmdiff[0];
            cursong = song;
        }
Example #8
0
        Layout CreateContent()
        {
            _listViewItemSource = new ObservableCollection <Grouping1 <string, ContactViewModel1> >();

            _contactsListView = new ListView()
            {
                ItemsSource            = _listViewItemSource,
                IsPullToRefreshEnabled = true,
                IsGroupingEnabled      = true,
                GroupShortNameBinding  = new Binding("Key"),
                GroupHeaderTemplate    = new DataTemplate(typeof(HeaderCell)),
                HasUnevenRows          = true,
                ItemTemplate           = new DataTemplate(typeof(ContactItemTemplate))
            };

            _contactsListView.Refreshing += contactsListView_Refreshing;
            _searchBtn = new Button()
            {
                Text = "Search"
            };
            _searchBtn.Clicked += (object sender, EventArgs e) => _contactsListView.BeginRefresh();

            Grid grd = new Grid();

            grd.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });
            grd.RowDefinitions.Add(new RowDefinition());
            grd.Children.Add(_searchBtn);
            grd.Children.Add(_contactsListView);
            Grid.SetRow(_contactsListView, 1);
            return(grd);
        }
Example #9
0
        /// <summary>
        /// Filters the list view.
        /// </summary>
        /// <param name="listView">List view.</param>
        /// <param name="filter">Filter.</param>
        /// <param name="source">Source.</param>
        protected override void FilterListView(ListView listView, string filter, IEnumerable <EntityBase> source)
        {
            listView.BeginRefresh();

            if (string.IsNullOrWhiteSpace(filter))
            {
                EntityGroup.GroupEntities <T> (EntityList.Entities, (results) => {
                    Device.BeginInvokeOnMainThread(() => {
                        listView.ItemsSource = results;
                        listView.EndRefresh();
                        IsSearching = false;
                    });
                });
            }
            else
            {
                Task.Factory.StartNew(() => {
                    EntityGroup.GroupEntities <T>(EntityList.Entities.Where(x => x.ToString().ToLower().Contains(filter.ToLower())), (results) => {
                        Device.BeginInvokeOnMainThread(() => {
                            listView.ItemsSource = results;
                            listView.EndRefresh();
                            IsSearching = false;
                        });
                    });
                });
            }
        }
Example #10
0
        protected override void OnAppearing()
        {
            base.OnAppearing();

            _addPhotoToolbarItem.Clicked      += HandleAddPhotoToolbarItemClicked;
            _viewModel.PullToRefreshCompleted += HandlePullToRefreshCompleted;

            _photosListView.BeginRefresh();
        }
Example #11
0
        protected override void OnAppearing()
        {
            base.OnAppearing();

            if (_storiesListView.ItemsSource is null)
            {
                _storiesListView.BeginRefresh();
            }
        }
Example #12
0
        protected override void OnAppearing()
        {
            base.OnAppearing();

            if (_storiesListView.ItemsSource is ICollection collection && collection.Count <= 0)
            {
                _storiesListView.BeginRefresh();
            }
        }
        protected override void OnAppearing()
        {
            base.OnAppearing();

            if (speakersListView.ItemsSource is ObservableCollection <Speaker> speakerCollection && speakerCollection.Count is 0)
            {
                speakersListView.BeginRefresh();
            }
        }
Example #14
0
 private async void addOrder(object sender, EventArgs e)
 {
     orderListView.BeginRefresh();
     currentOrder.Parts.Insert(0, App.Menu.getCopyMealByName((sender as Button).Text));
     orderListView.ItemsSource = null;
     orderListView.ItemsSource = currentOrder.Parts;
     currentPrice.Text         = currentOrder.Price.ToString() + "€";
     orderListView.EndRefresh();
 }
Example #15
0
        protected override void Init()
        {
            On <iOS>().SetPrefersLargeTitles(true);
            var items = new List <string>();

            for (int i = 0; i < 1000; i++)
            {
                items.Add($"pull to {DateTime.Now.Ticks}");
            }
            var page = new ContentPage
            {
                Title = "Pull Large Titles"
            };

            var lst = new ListView();

            lst.IsPullToRefreshEnabled = true;
            lst.ItemsSource            = items;
            lst.RefreshCommand         = new Command(async() =>
            {
                var newitems = new List <string>();
                newitems.Add("data refreshed");
                await Task.Delay(5000);
                for (int i = 0; i < 1000; i++)
                {
                    newitems.Add($"data {DateTime.Now.Ticks} refreshed");
                }
                lst.ItemsSource = newitems;
                lst.EndRefresh();
            });
            page.Content = new StackLayout {
                Children = { lst }
            };
            page.Appearing += async(sender, e) =>
            {
                await Task.Delay(500);

                lst.BeginRefresh();
            };
            page.ToolbarItems.Add(new ToolbarItem {
                Text = "Refresh", Command = new Command((obj) => lst.BeginRefresh()), AutomationId = "btnRefresh"
            });
            Navigation.PushAsync(page);
        }
Example #16
0
        private async Task AddTask()
        {
            DictModel dict = await OverlayForm(taskForm);

            if (dict != null)
            {
                dict.Add("list", listName);

                await App.CreateTask(dict, project);

                list.BeginRefresh();
            }
        }
Example #17
0
        public TrailSearch()
        {
            Title           = "Procurar trilhas";
            BackgroundColor = Color.White;

            Content = HelperItens.Load();

            lvSearch = new ListView
            {
                ItemTemplate = new DataTemplate(() =>
                {
                    var dtLvOpcoes = new CustomCellTrail();
                    dtLvOpcoes.SetBinding(CustomCellTrail.NameProperty, "TrailName");
                    dtLvOpcoes.SetBinding(CustomCellTrail.DistanceProperty, "DistShownd");
                    dtLvOpcoes.SetBinding(CustomCellTrail.TimeProperty, "TimeShownd");

                    return(dtLvOpcoes);
                }),
                SeparatorColor  = Color.White,
                BackgroundColor = Color.White
            };

            lvSearch.ItemSelected += (sender, e) =>
            {
                var selectedIten = (Trail)e.SelectedItem;
                if (selectedIten == null)
                {
                    return;
                }

                // Cleans the selection
                ((ListView)sender).SelectedItem = null;
            };

            sb = new SearchBar()
            {
                Placeholder   = "Digite sua pesquisa aqui",
                SearchCommand = new Command(() =>
                {
                    lvSearch.BeginRefresh();

                    trails.Sort((x, y) => x.TrailName.CompareTo(y.TrailName));
                    lvSearch.ItemsSource = trails;

                    lvSearch.EndRefresh();
                })
            };

            LoadScreen();
        }
        private void searchBar_OnTextChanged(object sender, TextChangedEventArgs e)
        {
            cardItemsList.BeginRefresh();

            if (string.IsNullOrWhiteSpace(e.NewTextValue))
            {
                cardItemsList.ItemsSource = baseDataSet;
            }
            else
            {
                cardItemsList.ItemsSource = baseDataSet.Where(i => i.name.ToLower().Contains(e.NewTextValue.ToLower()));
            }

            cardItemsList.EndRefresh();
        }
 public void FilterLocations(ListView lv, string filter)
 {
     lv.BeginRefresh();
     if (string.IsNullOrWhiteSpace(filter))
     {
         lv.ItemsSource = favViewModel.FavList;
     }
     else
     {
         lv.ItemsSource = favViewModel.FavList
                          .Where(x => x.title.ToLower()
                                 .Contains(filter.ToLower()));
     }
     lv.EndRefresh();
 }
Example #20
0
        protected override void OnAppearing()
        {
            base.OnAppearing();

            /*
             * for (int i=0; i< AppModel.Instance.WallPostsWrapper.Count; i++)
             * {
             *  AppModel.Instance.WallPostsWrapper[i].CreatedUser = AppModel.Instance.Users.Find(AppModel.Instance.WallPostsWrapper[i].CreatedUserId);
             * }
             */



            _wallPostListView.BeginRefresh();
        }
Example #21
0
        protected virtual void FilterListView(ListView listView, string filter, IEnumerable <EntityBase> source)
        {
            listView.BeginRefresh();

            if (string.IsNullOrWhiteSpace(filter))
            {
                listView.ItemsSource = source;
            }
            else
            {
                listView.ItemsSource = (source.Where(x => x.ToString().ToLower().Contains(filter.ToLower())));
            }

            IsSearching = false;
            listView.EndRefresh();
        }
Example #22
0
        //Filter bank ids
        private void FilterBanks(string filter)
        {
            _listView.BeginRefresh();

            if (string.IsNullOrWhiteSpace(filter))
            {
                _listView.ItemsSource = ListAccounts;
            }
            else
            {
                _listView.ItemsSource = ListAccounts
                                        .Where(x => x.bank_id.ToLower()
                                               .Contains(filter.ToLower()));
            }

            _listView.EndRefresh();
        }
Example #23
0
        //private async void _addButton_Clicked(object sender, EventArgs e)
        //{
        //    await Navigation.PushAsync(new AddCompanyPage());
        //}

        private async void _button_Clicked(object sender, EventArgs e)
        {
            var  db     = new SQLiteConnection(_dbPath);
            bool result = await DisplayAlert("Delete " + _company.Name, "Confirm Delete?", "Confirm", "Cancel");

            if (result)
            {
                db.Table <Company>().Delete(x => x.Id == _company.Id);
            }
            else
            {
                await DisplayAlert(null, "No changes to " + _company.Name, "Ok");
            }

            _listView.BeginRefresh();
//            await Navigation.PopAsync();
        }
Example #24
0
        public void SearchBarButtonPressedChanged(object sender, EventArgs e)
        {
            listView.BeginRefresh();
            SearchBar      SearchBarSender = sender as SearchBar;
            string         Text            = SearchBarSender.Text;
            List <JobCell> List            = FormListFromText(Text);

            if (List != null && List.Count > 0)
            {
                listView.ItemsSource = List;
            }
            else
            {
                updateList(Maincnx, null);
            }

            listView.EndRefresh();
        }
Example #25
0
        public void FilterContacts(string filter)
        {
            _listView.BeginRefresh();

            if (string.IsNullOrWhiteSpace(filter))
            {
                _listView.ItemsSource = test.banks;
            }
            else
            {
                Debug.WriteLine("test first bank {0}", test.banks[0].full_name);
                _listView.ItemsSource = test.banks
                                        .Where(x => x.short_name.ToLower()
                                               .Contains(filter.ToLower()));
            }

            _listView.EndRefresh();
        }
Example #26
0
        private void User_List_deleteButton_Clicked(object sender, EventArgs e)
        {
            var db = new SQLiteConnection(_dbPath);

            _listView.BeginRefresh();
            db.Table <User>().Delete(x => x.Id == _user.Id);

            _deleteButton.IsEnabled = false;

            /*to get the listview to refresh after deletion, this is the way*/
            _listView.ItemsSource = null;
            _listView.ItemsSource = db.Table <User>().OrderBy(x => x.Email).ToList();

            /*this does it but it flashes the main page for half a second*/
            //Navigation.RemovePage(this);
            //await Navigation.PushAsync(new UserList());

            _listView.EndRefresh();
        }
Example #27
0
        private void FilterDate(string filter)
        {
            //preparing for the list
            _listView.BeginRefresh();

            if (string.IsNullOrWhiteSpace(filter))
            {
                //If nothing changed stays the same
                _listView.ItemsSource = transactionList.transactions;
            }
            else
            {
                //Changes the asked for date according to what was searched
                _listView.ItemsSource = transactionList.transactions
                                        .Where(x => x.details.completed.ToLower()
                                               .Contains(filter.ToLower()));
            }

            _listView.EndRefresh();
        }
Example #28
0
		public StorePage ()
		{
			Title = "Magasins";
			var dataTemplate = new DataTemplate (typeof(TextCell));
			dataTemplate.SetBinding (TextCell.TextProperty, "name");

			list = new ListView ();
			list.ItemTemplate = dataTemplate;
			list.IsPullToRefreshEnabled = true;
			list.RefreshCommand = new Command (() => loadStoreData());

			list.ItemSelected += (object sender, SelectedItemChangedEventArgs e) => {
				if(e.SelectedItem == null)
					return;
				Store store = (Store)e.SelectedItem;
				list.SelectedItem = null;
				this.Navigation.PushAsync (new CategoryPage(store.uid));
			};

			Content = list;
			list.BeginRefresh ();
		}
        //AutoPopulating the recipient information from pulled Account list
        private void autoPopulateEntry(Entry eusSelected)
        {
            List <DevicesIngestData> receipientAutoFill = new List <DevicesIngestData>();

            foreach (var item in accountList)
            {
                if (eusSelected.Text.ToString().Equals(item.username))
                {
                    receipientAutoFill.Add(new DevicesIngestData {
                        Title = "Recipient Location", SubTitle = item.location, TopPadding = new Thickness(0, 0, 0, 0), DeviceColor = Color.Orange, enableEntry = false
                    });
                    receipientAutoFill.Add(new DevicesIngestData {
                        Title = "Recipient CostCode", SubTitle = item.costCode, TopPadding = new Thickness(0, 0, 0, 0), DeviceColor = Color.Orange, enableEntry = false
                    });
                    recipientCostCode = item.costCode;
                    ingestDeviceRecipientLv.BeginRefresh();
                    ingestDeviceRecipientLv.ItemsSource = receipientAutoFill;
                    ingestDeviceRecipientLv.EndRefresh();
                    eusSelected.TextColor = Color.Gray;
                }
            }
        }
Example #30
0
        public App()
        {
            BindingContext = vm;


            ListView lv = new ListView()
            {
                ItemsSource            = vm.details,
                IsPullToRefreshEnabled = true,
                RefreshCommand         = vm.Scan
            };

            lv.SetBinding(ListView.IsRefreshingProperty, "isBusy", BindingMode.OneWay);

            DataTemplate dt = new DataTemplate(typeof(TextCell));

            dt.SetBinding(TextCell.TextProperty, "Name");
            dt.SetBinding(TextCell.DetailProperty, "Gid");

            lv.ItemTemplate = dt;

            // The root page of your application
            var content = new ContentPage
            {
                Title   = "BluetoothScanner",
                Content = new StackLayout
                {
                    Children =
                    {
                        lv
                    }
                }
            };

            content.ToolbarItems.Add(new ToolbarItem("Scan", null, () => lv.BeginRefresh()));

            MainPage = new NavigationPage(content);
        }
Example #31
0
        private void OnTextChanged(string text, ListView viewlist, ObservableCollection <IList> dataList)
        {
            viewlist.IsVisible = true;
            viewlist.BeginRefresh();

            try
            {
                var data = dataList.Where(i => i.Address.ToLower().Contains(text.ToLower()));
                if (string.IsNullOrWhiteSpace(text))
                {
                    viewlist.IsVisible = false;
                }
                else
                {
                    viewlist.ItemsSource = data;
                }
            }
            catch (Exception)
            {
                viewlist.IsVisible = false;
            }
            viewlist.EndRefresh();
        }
Example #32
0
		public CategoryPage (String uid)
		{
			Title = "Catégories";
			var dataTemplate = new DataTemplate (typeof(TextCell));
			dataTemplate.SetBinding (TextCell.TextProperty, "name");

			list = new ListView ();
			list.ItemTemplate = dataTemplate;
			list.IsPullToRefreshEnabled = true;
			list.RefreshCommand = new Command (() => loadCategoryData());

			list.ItemSelected += (object sender, SelectedItemChangedEventArgs e) => {
				if(e.SelectedItem == null)
					return;
				Category category = (Category)e.SelectedItem;
				list.SelectedItem = null;
				this.Navigation.PushAsync (new ProductPage(category.uid));
			};

			Content = list;
			this.storeUid = uid;
			list.BeginRefresh ();
		}
 public void RefreshView()
 {
     lock (_bot)
     {
         if (_bot.Game != null && _bot.Game.IsMapLoaded && _bot.Game.Players != null)
         {
             IEnumerable <PlayerInfos> playersList = _bot.Game.Players.Values.OrderBy(e => e.Added);
             List <string>             playerNames = new List <string>();
             foreach (PlayerInfos player in playersList)
             {
                 string petName = "";
                 if (player.PokemonPetId < PokemonNamesManager.Instance.Names.Length)
                 {
                     petName = PokemonNamesManager.Instance.Names[player.PokemonPetId];
                     if (player.IsPokemonPetShiny)
                     {
                         petName = "(s)" + petName;
                     }
                 }
                 listToDisplay.Add(new PlayerInfosView
                 {
                     Distance = _bot.Game.DistanceTo(player.PosX, player.PosY),
                     Name     = player.Name,
                     Position = "(" + player.PosX + ", " + player.PosY + ")",
                     Status   = player.IsAfk ? "AFK" : (player.IsInBattle ? "BATTLE" : ""),
                     Follower = petName,
                     Guild    = player.GuildId.ToString(),
                     LastSeen = (DateTime.UtcNow - player.Updated).Seconds.ToString() + "s"
                 });
                 playerNames.Add(player.Name);
             }
             PlayerListView.ItemsSource = playerNames;
             PlayerListView.BeginRefresh();
             PlayerListView.EndRefresh();
         }
     }
 }
        public CategoryListEditPage()
        {
            NavigationPage.SetHasNavigationBar (this, false);
            App.MasterDetailPage.IsPresented = false;
            InitializeComponent ();
            var user = App.user;
            var categoryView = new ListView();
            var api = new Api ();
            categoryView.SeparatorColor = Color.FromHex ("E6E2DB");
            categoryView.BeginRefresh ();
            categoryView.ItemTemplate = new DataTemplate (typeof(CategoryEditCell));
            if (user != null) {
                var categories = api.getCategories (user);
                categoryView.ItemsSource = categories;
            }
            categoryView.ItemTapped += (sender, e) => {
                categoryView.SelectedItem = null;
                App.MasterDetailPage.Detail = new CategoryEditPage(e.Item as Category);

            };
            categoryView.EndRefresh ();

            //this.Padding = new Thickness (10, 30, 10, 5);

            // Set the content for the page.
            this.Content = new StackLayout {
                BackgroundColor = Color.FromHex("E6E2DB"),
                Children = {
                    new StackLayout{
                        Padding = new Thickness (10, 40, 10, 15),
                        BackgroundColor = Color.FromHex("525151"),
                        HorizontalOptions = LayoutOptions.FillAndExpand,
                        VerticalOptions = LayoutOptions.FillAndExpand,
                        Orientation = StackOrientation.Horizontal,
                        Children = {
                            new Label {
                                HorizontalOptions = LayoutOptions.CenterAndExpand,
                                Text = "Управление товаром",
                                TextColor = Color.White
                            }
                        }
                    },

                    new StackLayout{
                        Padding = new Thickness (0, 40, 0, 0),
                        BackgroundColor = Color.FromHex("E6E2DB"),
                        HorizontalOptions = LayoutOptions.FillAndExpand,
                        VerticalOptions = LayoutOptions.FillAndExpand,
                        Children = {
                            new Label {
                                HorizontalOptions = LayoutOptions.StartAndExpand,
                                VerticalOptions = LayoutOptions.End,
                                Text = "Категории",
                                TextColor = Color.FromHex("666")
                            },
                            categoryView

                            }
                        }
                    },

            };
        }
Example #35
0
        public SalesReportPage()
        {
            InitializeComponent ();
            ListView checkView = new ListView();
            User user = App.user;
            ListView categoryView = new ListView();
            Label mainLabel = new Label ();
            mainLabel.Text = "Отчет продаж";
            mainLabel.HorizontalOptions = LayoutOptions.Center;
            mainLabel.TextColor = Color.FromHex ("FFFFFF");

            var menuCheck = new Image ();
            menuCheck.Source = "menuCheck.png";

            var menuUser = new Image ();
            menuUser.Source = "menuUser.png";

            var sellsLabel = new Label{ TextColor = Color.FromHex("838282"), FontSize = 10, Text = "общая касса", HorizontalOptions = LayoutOptions.EndAndExpand };
            var checkLabel = new Label{ TextColor = Color.FromHex("838282"), FontSize = 10, Text = "средний чек", HorizontalOptions = LayoutOptions.EndAndExpand  };
            var guestLabel = new Label{ TextColor = Color.FromHex("838282"), FontSize = 10, Text = "посетители", HorizontalOptions = LayoutOptions.EndAndExpand  };
            var timeLabel = new Label{ TextColor = Color.FromHex("838282"), FontSize = 10, Text = "время смены", HorizontalOptions = LayoutOptions.EndAndExpand  };
            var sellsCountLabel = new Label{ TextColor = Color.White, Text = "0.00", HorizontalOptions = LayoutOptions.Start  };
            var checkCountLabel = new Label{ TextColor = Color.White, Text = "0", HorizontalOptions = LayoutOptions.Start };
            var guestCountLabel = new Label{ TextColor = Color.White, Text = "0", HorizontalOptions = LayoutOptions.Start };
            var timeCountLabel = new Label{ TextColor = Color.White, Text = "00:00" , HorizontalOptions = LayoutOptions.Start};

            Label middleCheck = new Label ();
            middleCheck.Text = "Средний чек: 0 грн";
            middleCheck.TextColor = Color.FromHex ("FFFFFF");
            Label totalGuests = new Label ();
            totalGuests.TextColor = Color.FromHex ("FFFFFF");
            totalGuests.Text = "Количество гостей: 0 Человек";
            Api api = new Api ();

            Series lineSeries = new Series
            {
                Color = Color.FromHex("FFC944"),
                Type = ChartType.Line
            };
            lineSeries.Points.Add(new DataPoint() { Label = "Jan1",   Value = 0 });
            lineSeries.Points.Add(new DataPoint() { Label = "Jan2",   Value = 5 });
            lineSeries.Points.Add(new DataPoint() { Label = "Jan3",   Value = 1 });
            lineSeries.Points.Add(new DataPoint() { Label = "Jan4",   Value = 0 });
            lineSeries.Points.Add(new DataPoint() { Label = "March", Value = 0 });
            Chart reportChart = new Chart {
                //Color = Color.White,
                WidthRequest = 321,
                HeightRequest = 247,
                Spacing = 10,
                Grid = true,
                BackgroundColor = Color.FromHex("666666"),
                Color = Color.FromHex("777"),
            };
            reportChart.Series.Add (lineSeries);

            DatePicker dateStartPicker = new DatePicker
            {
                Format = "d MMMM yyyy",
                VerticalOptions = LayoutOptions.CenterAndExpand,
                BackgroundColor = Color.FromHex("666666"),
            };
            DatePicker dateEndPicker = new DatePicker
            {
                Format = "d MMMM yyyy",
                BackgroundColor = Color.FromHex("666666"),
                VerticalOptions = LayoutOptions.CenterAndExpand
            };
            categoryView.BeginRefresh ();

            categoryView.ItemTemplate = new DataTemplate (typeof(CategoryReportCell));
            if (user != null) {
                var categories = api.getCategories (user);
                categoryView.ItemsSource = categories;
            }
            categoryView.EndRefresh ();

            checkView.ItemsSource = new string[]{
                "Чеков без оплаты 0 >",
                "Чеков со скидкой 0 >"
            };

            var line = new BoxView{
                Color = Color.FromHex("838282"),
                WidthRequest = 100,
                HeightRequest = 1
            };

            this.Padding = new Thickness (0, Device.OnPlatform (0, 0, 0), 0, 5);
            var headerLayout = new StackLayout{
                Children = {
                    mainLabel,
                    reportChart,
                    new StackLayout{
                        Padding = new Thickness(10,0,10,0),
                        Spacing = 5,
                        Orientation = StackOrientation.Horizontal,
                        Children = {
                            menuCheck,
                            checkCountLabel,
                            checkLabel
                        }
                    },
                    line,
                    new StackLayout{
                        Padding = new Thickness(10,0,10,0),
                        Spacing = 5,
                        Orientation = StackOrientation.Horizontal,
                        Children = {
                            menuUser,
                            guestCountLabel,
                            guestLabel
                        }
                    },
                    dateStartPicker,
                    dateEndPicker,
                },
                BackgroundColor = Color.FromHex("666666"),
                Padding = new Thickness(10,20,10,0),

            };
            var contentLayout = new StackLayout{
                Padding = new Thickness(10,0,10,0),
                Children = {
                    checkView,
                    categoryView
                }
            };
            // Set the content for the page.
            this.Content = new ScrollView{
                Content = new StackLayout {
                Children = {
                    headerLayout,
                    contentLayout
                    }
                },
            };
        }