当前位置: 首页>>代码示例>>C#>>正文


C# ListView.BeginRefresh方法代码示例

本文整理汇总了C#中ListView.BeginRefresh方法的典型用法代码示例。如果您正苦于以下问题:C# ListView.BeginRefresh方法的具体用法?C# ListView.BeginRefresh怎么用?C# ListView.BeginRefresh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ListView的用法示例。


在下文中一共展示了ListView.BeginRefresh方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ProductPage

		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 ();
		}
开发者ID:rgdev,项目名称:Xmazon,代码行数:25,代码来源:ProductPage.cs

示例2: StorePage

		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 ();
		}
开发者ID:rgdev,项目名称:Xmazon,代码行数:22,代码来源:StorePage.cs

示例3: CategoryPage

		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 ();
		}
开发者ID:rgdev,项目名称:Xmazon,代码行数:23,代码来源:CategoryPage.cs

示例4: SalesReportPage

        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
//.........这里部分代码省略.........
开发者ID:sliderif,项目名称:Coffetab,代码行数:101,代码来源:SalesReportPage.xaml.cs

示例5: CategoryListEditPage

        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

                            }
                        }
                    },

            };
        }
开发者ID:sliderif,项目名称:Coffetab,代码行数:63,代码来源:CategoryListEditPage.xaml.cs


注:本文中的ListView.BeginRefresh方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。