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


C# Forms.ActivityIndicator类代码示例

本文整理汇总了C#中Xamarin.Forms.ActivityIndicator的典型用法代码示例。如果您正苦于以下问题:C# ActivityIndicator类的具体用法?C# ActivityIndicator怎么用?C# ActivityIndicator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ActivityIndicator类属于Xamarin.Forms命名空间,在下文中一共展示了ActivityIndicator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ActivityIndicatorDemoPage

        public ActivityIndicatorDemoPage()
        {
            Label header = new Label
            {
                Text = "ActivityIndicator",
                Font = Font.SystemFontOfSize(40, FontAttributes.Bold),
                HorizontalOptions = LayoutOptions.Center
            };

            ActivityIndicator activityIndicator = new ActivityIndicator
            {
                Color = Device.OnPlatform(Color.Black, Color.Default, Color.Default),
                IsRunning = true,
                VerticalOptions = LayoutOptions.CenterAndExpand
            };

            // Build the page.
            this.Content = new StackLayout
            {
                Children = 
                {
                    header,
                    activityIndicator
                }
            };
        }
开发者ID:nrogoff,项目名称:xamarin-forms-samples,代码行数:26,代码来源:ActivityIndicatorDemoPage.cs

示例2: BaseAsyncActivityTemplate

			public BaseAsyncActivityTemplate() {
				// Adds the Content Presenter
				var contentPresenter = new ContentPresenter();
				Children.Add(contentPresenter, 0, 0);

				// The overlay that is presented when an Activity is Running
				var overlayGrid = new Grid { BackgroundColor = Color.FromHex("#CCCCCCCC") };
				overlayGrid.SetBinding(IsVisibleProperty, new TemplateBinding("IsActivityRunning"));

				var descriptionLabel = new Label { TextColor = Color.White };
				descriptionLabel.SetBinding(Label.TextProperty, new TemplateBinding("ActivityDescription"));

				var activityIndicator = new ActivityIndicator { Color = Color.White };
				activityIndicator.SetBinding(ActivityIndicator.IsRunningProperty, new TemplateBinding("IsActivityRunning"));

				// A layout to hold the Activity Indicator and Description
				var activityIndicatorLayout = new StackLayout {
					HorizontalOptions = LayoutOptions.Center,
					VerticalOptions = LayoutOptions.Center,
				};
				activityIndicatorLayout.Children.Add(activityIndicator);
				activityIndicatorLayout.Children.Add(descriptionLabel);

				// Finally add the indicator to the overlay and the overlay to the grid
				overlayGrid.Children.Add(activityIndicatorLayout, 0, 0);
				Children.Add(overlayGrid);
			}
开发者ID:Caeno,项目名称:Lib-XamarinForms-Toolkit,代码行数:27,代码来源:BaseAsyncActivityContentPage.cs

示例3: EventListView

        public EventListView(EventViewModel viewModel)
        {
            BindingContext = viewModel;

            var stack = new StackLayout
            {
                Orientation = StackOrientation.Vertical,
                Padding = new Thickness(0, 10)
            };

            var progress = new ActivityIndicator
            {
                IsEnabled = true,
                Color = Color.White
            };

            progress.SetBinding(IsVisibleProperty, "IsBusy");
            progress.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");

            stack.Children.Add(progress);

            var listView = new ListView {ItemsSource = viewModel.Events};

            var itemTemplate = new DataTemplate(typeof (TextCell));
            itemTemplate.SetBinding(TextCell.TextProperty, "Name");
            listView.ItemTemplate = itemTemplate;

            stack.Children.Add(listView);

            Content = stack;
        }
开发者ID:sguertl,项目名称:MeetupEvents-XamarinForms,代码行数:31,代码来源:EventListView.cs

示例4: GroupMatchView

        public GroupMatchView()
        {
            BindingContext = new GroupMatchesViewModel();

            var activity = new ActivityIndicator
            {
                Color = Helpers.Color.Greenish.ToFormsColor(),
                IsEnabled = true
            };
            activity.SetBinding(ActivityIndicator.IsVisibleProperty, "IsBusy");
            activity.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");

            this.Groups = new ObservableCollection<GroupHelper>();
            var refresh = new ToolbarItem
            {
                Command = ViewModel.LoadItemsCommand,
                Icon = "refresh.png",
                Name = "refresh",
                Priority = 0
            };
            ToolbarItems.Add(refresh);

            ViewModel.ItemsLoaded += new EventHandler((sender, e) =>
            {
                this.Groups.Clear();
                ViewModel.Result.Select(r => r.MatchDate).Distinct().ToList()
                    .ForEach(r => Groups.Add(new GroupHelper(r)));
                foreach (var g in Groups)
                {
                    foreach (var match in ViewModel.Result.Where(m=> m.MatchDate == g.Date))
                    {
                        g.Add(match);
                    }
                }
            });

            Title = "Group Match Schedule";
            var stack = new StackLayout
            {
                Orientation = StackOrientation.Vertical,
                Padding = new Thickness(0, 0, 0, 8)
            };

            var listView = new ListView
            {
                IsGroupingEnabled = true,
                GroupDisplayBinding = new Binding("Date"),
            };

            var viewTemplate = new DataTemplate(typeof(ScoreCell));

            listView.ItemTemplate = viewTemplate;

            listView.ItemsSource = Groups;
            stack.Children.Add(activity);

            stack.Children.Add(listView);

            Content = stack;
        }
开发者ID:AjourMedia,项目名称:FootballTournament2014,代码行数:60,代码来源:GroupMatchView.cs

示例5: ActivityIndicatorDemoPage

        public ActivityIndicatorDemoPage()
        {
            Label header = new Label
            {
                Text = "ActivityIndicator",
                Font = Font.BoldSystemFontOfSize(40),
                HorizontalOptions = LayoutOptions.Center
            };

            ActivityIndicator activityIndicator = new ActivityIndicator
            {
                Color = Device.OnPlatform(Color.Black, Color.Default, Color.Default),
                IsRunning = true,
                VerticalOptions = LayoutOptions.CenterAndExpand
            };

            // Accomodate iPhone status bar.
            this.Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5);

            // Build the page.
            this.Content = new StackLayout
            {
                Children = 
                {
                    header,
                    activityIndicator
                }
            };
        }
开发者ID:Biotelligent,项目名称:xamarin-forms-samples,代码行数:29,代码来源:ActivityIndicatorDemoPage.cs

示例6: AbsoluteOverlay

        public AbsoluteOverlay()
        {
            _indicator = new ActivityIndicator {
                Color = Color.White,
            };

            _label = new Label {
                TextColor = Color.White,
                FontSize = Device.GetNamedSize (NamedSize.Small, typeof(Label))
            };

            _overlay = new StackLayout {
                BackgroundColor = Color.Black,
                Opacity = .5f,
                Children = {
                    new StackLayout {
                        HorizontalOptions = LayoutOptions.CenterAndExpand,
                        VerticalOptions = LayoutOptions.CenterAndExpand,
                        Children = {
                            _indicator, _label
                        }
                    }

                }
            };

            Hide ();
        }
开发者ID:danielmahadi,项目名称:JiraIt,代码行数:28,代码来源:AbsoluteOverlay.cs

示例7: EmployeeListViewPage

        public EmployeeListViewPage()
        {

            BindingContext = new EmployeeViewModel();
            var activity = new ActivityIndicator
            {
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                Color = Color.White,
                //IsEnabled = true
            };
            activity.SetBinding(ActivityIndicator.IsVisibleProperty, "IsBusy");
            activity.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");

            //Command
            ViewModel.LoadAllEmployees.Execute(null);

            _iiEmpList = new iiListView()
            {
                ItemTemplate = new DataTemplate(typeof(EmployeeNameCell)),
                ClassId="1",    
                RowHeight=70
            };
            Content = new StackLayout
            {
                Children = {
                    activity,
					_iiEmpList
				}
            };
            _iiEmpList.ItemTapped += _iiEmpList_ItemTapped;
        }
开发者ID:XnainA,项目名称:InsideInning,代码行数:31,代码来源:EmployeeListViewPage.cs

示例8: LoadingPlaceholder

		public LoadingPlaceholder ()
		{
			Padding = new Thickness (20);
			Title = "Image Loading Gallery";

			var source = new UriImageSource {
				Uri = new Uri ("http://www.nasa.gov/sites/default/files/styles/1600x1200_autoletterbox/public/images/298773main_EC02-0282-3_full.jpg"),
				CachingEnabled = false
			};

			var image = new Image {
				Source = source,
				WidthRequest = 200,
				HeightRequest = 200,
			};

			var indicator = new ActivityIndicator {Color = new Color (.5),};
			indicator.SetBinding (ActivityIndicator.IsRunningProperty, "IsLoading");
			indicator.BindingContext = image;

			var grid = new Grid();
			grid.RowDefinitions.Add (new RowDefinition());


			grid.Children.Add (image);
			grid.Children.Add (indicator);


			Content = grid;
		}
开发者ID:Nepomuceno,项目名称:xamarin-forms-samples,代码行数:30,代码来源:LoadingPlaceholder.cs

示例9: AlertView

        public AlertView()
        {
            Device.OnPlatform (() => {
                Padding = new Thickness (0, 40, 0, 0);
            });

            this.BackgroundColor = Color.Gray;

            var label = new LabelRender();

            var loading = new ActivityIndicator(){ IsRunning = true};

            this.Children.Add(loading);

            label.Text = TextConstant.Wait;

            label.TextColor = Color.White;

            label.HorizontalOptions = LayoutOptions.CenterAndExpand;

            label.VerticalOptions = LayoutOptions.CenterAndExpand;

            this.HorizontalOptions = LayoutOptions.CenterAndExpand;

            this.Children.Add(label);

            this.WidthRequest = 200;

            this.HeightRequest = 80;
        }
开发者ID:QualityConsultingTeam,项目名称:ECanchaMobile,代码行数:30,代码来源:AlertView.cs

示例10: GetContent

		public async void GetContent()
		{
			indicator = new ActivityIndicator {
				IsRunning = true,
				Color = Color.Black,
				HorizontalOptions = LayoutOptions.FillAndExpand,
				VerticalOptions = LayoutOptions.FillAndExpand
			};


			layout.Children.Add (indicator);

			List<UserListModel> userList = await UserControl.GetUserListAsync ();

			layout.Children.Remove (indicator);

			userListView = new ListView {
				ItemsSource = userList,
				ItemTemplate = new DataTemplate (typeof(UserCell)),
				RowHeight = 80
			};
			userListView.ItemTapped += (object sender, ItemTappedEventArgs e) => {
				UserListModel cell = e.Item as UserListModel;
				Navigation.PushAsync(new UserPage(cell.UserId));
				userListView.SelectedItem = null;
			};
		
			layout.Children.Add (userListView);
		}
开发者ID:jasonmcgraw,项目名称:UserBrowse,代码行数:29,代码来源:BrowsePage.cs

示例11: DeparturesContentPage

		public DeparturesContentPage (Route selectedRoute)
		{

			var indicator = new ActivityIndicator() {
				HorizontalOptions = LayoutOptions.CenterAndExpand
			};

			this.Title = "Departures";
			var listView = new ListView {
				
				ItemTemplate = new DataTemplate (typeof(TextCell)) {
					Bindings = { {
							TextCell.TextProperty,
							new Binding ("Time")
						}
					}
				}
			};

			var root = new StackLayout() {
				HorizontalOptions = LayoutOptions.FillAndExpand,
				VerticalOptions = LayoutOptions.FillAndExpand,
				Children = {
					listView, 
					indicator
				}
			};

			this.Content = root;

			Initialize (selectedRoute,listView,indicator);
		}
开发者ID:arctouch-gabrielzandavalle,项目名称:busroutes,代码行数:32,代码来源:DeparturesContentPage.cs

示例12: BalanceLeaveViewPage

        public BalanceLeaveViewPage()
        {
            BindingContext = new EmployeeViewModel();
            var activity = new ActivityIndicator
            {
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                Color = Color.White.ToFormsColor(),
                //IsEnabled = true
            };
            activity.SetBinding(ActivityIndicator.IsVisibleProperty, "IsBusy");
            activity.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");
            ViewModel.LoadAllEmployees.Execute(null);
            listView = new iiListView()
            {
                ItemTemplate = new DataTemplate(typeof(NameCell))
            };

            BackgroundImage = "back";
            Content = new StackLayout
            {
                // HorizontalOptions = LayoutOptions.FillAndExpand,
                Padding = new Thickness(20, 70, 20, 20),
                Spacing=20,
                Children = 
                {
                    activity,  
                    listView,
                    GenCalGrid(),
                }
            };
            listView.ItemTapped += listView_ItemTapped;
        }
开发者ID:XnainA,项目名称:InsideInning,代码行数:32,代码来源:BalanceLeaveViewPage.cs

示例13: RssFeedView2

        public RssFeedView2()
        {
            this.viewModel = new RssFeedViewModel();
            this.BindingContext = viewModel;
            this.Title = "Rss Feed";

            var refresh = new ToolbarItem(){ Command = viewModel.ReloadCommand, Name = "Reload", Priority = 0 };
            ToolbarItems.Add(refresh);

            var stack = new StackLayout(){ Orientation = StackOrientation.Vertical };
            var activity = new ActivityIndicator(){ Color = Color.Blue, IsEnabled = true };
            activity.SetBinding(ActivityIndicator.IsVisibleProperty, "ShowActivityIndicator");
            activity.SetBinding(ActivityIndicator.IsRunningProperty, "ShowActivityIndicator");

            stack.Children.Add(activity);

            var listview = new ListView();
            listview.ItemsSource = viewModel.Records;
            var cell = new DataTemplate(typeof(ImageCell));
            cell.SetBinding(ImageCell.TextProperty, "Title");
            cell.SetBinding(ImageCell.ImageSourceProperty, "Image");
            listview.ItemTemplate = cell;
            listview.ItemSelected += async (sender, e) => {
                await Navigation.PushAsync(new RssWebView((RssRecordViewModel)e.SelectedItem));
                listview.SelectedItem = null;
            };

            stack.Children.Add(listview);

            Content = stack;
        }
开发者ID:jeffbmiller,项目名称:RSSFeeds,代码行数:31,代码来源:RssFeedView2.cs

示例14: HomePage

		public HomePage ()
		{
			// setup your ViewModel
			ViewModel = new HomePageViewModel
			{
				ButtonText = "Click Me!"
			};
			// Set the binding context to the newly created ViewModel
			BindingContext = ViewModel;

			// the button is what we're going to use to trigger a long running Async task
			// we're also going to bind the button text so that we can see the binding in action
			var actionButton = new Button();
			actionButton.SetBinding(Button.TextProperty, "ButtonText");
			actionButton.Clicked += async (sender, args) => await SomeLongRunningTaskAsync();

			// here's your activity indicator, it's bound to the IsBusy property of the BaseViewModel
			// those bindings are on both the visibility property as well as the IsRunning property
			var activityIndicator = new ActivityIndicator
			{
				Color = Color.Black,
			};
			activityIndicator.SetBinding(ActivityIndicator.IsVisibleProperty, "IsBusy");
			activityIndicator.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");

			// return the layout that includes all the above elements
			Content = new StackLayout
			{
				HorizontalOptions = LayoutOptions.FillAndExpand,
				VerticalOptions = LayoutOptions.FillAndExpand,
				BackgroundColor = Color.White,
				Children = {actionButton, activityIndicator}
			};
		}
开发者ID:fabianwilliams,项目名称:HowToActivityIndicatorInCode,代码行数:34,代码来源:HomePage.cs

示例15: PublicRoomsPage

        public PublicRoomsPage(ViewModelBase viewModel)
            : base(viewModel)
        {
            var listView = new BindableListView
                {
                    ItemTemplate = new DataTemplate(() =>
                        {
                        var textCell = new TextCell();
                            textCell.SetBinding(TextCell.TextProperty, new Binding("Name"));
                            textCell.TextColor = Styling.BlackText;
                            //textCell.SetBinding(TextCell.DetailProperty, new Binding("Description"));
                            return textCell;
                        }),
                    SeparatorVisibility = SeparatorVisibility.None
                };

            listView.SetBinding(ListView.ItemsSourceProperty, new Binding("PublicRooms"));
            listView.SetBinding(BindableListView.ItemClickedCommandProperty, new Binding("SelectRoomCommand"));

            var loadingIndicator = new ActivityIndicator ();
            loadingIndicator.SetBinding(ActivityIndicator.IsRunningProperty, new Binding("IsBusy"));
            loadingIndicator.SetBinding(ActivityIndicator.IsVisibleProperty, new Binding("IsBusy"));

            Content = new StackLayout
            {
                Children =
                        {
                            loadingIndicator,
                            listView
                        }
            };
        }
开发者ID:alexnaraghi,项目名称:SharedSquawk,代码行数:32,代码来源:PublicRoomsPage.cs


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