本文整理汇总了C#中Xamarin.Forms.ActivityIndicator类的典型用法代码示例。如果您正苦于以下问题:C# ActivityIndicator类的具体用法?C# ActivityIndicator怎么用?C# ActivityIndicator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ActivityIndicator类属于Xamarin.Forms命名空间,在下文中一共展示了ActivityIndicator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: ListViewPageCS
public ListViewPageCS()
{
AddListItem(n);
// ListView のセルを定義します。
var cell = new DataTemplate(typeof(TextCell));
cell.SetBinding(TextCell.TextProperty, "TextItem");
cell.SetBinding(TextCell.DetailProperty, "DetailItem");
// ListView を定義します。
var list = new ListView
{
ItemsSource = listItems,
ItemTemplate = cell,
};
var indicator = new ActivityIndicator
{
IsRunning = true,
};
stack = new StackLayout
{
IsVisible = false,
Padding = 10,
Children =
{
indicator,
},
};
// ListView の各 Item が表示された時にイベントが発生します。
list.ItemAppearing += async (object sender, ItemVisibilityEventArgs e) =>
{
#if DEBUG
System.Diagnostics.Debug.WriteLine((e.Item as ListItem).TextItem);
System.Diagnostics.Debug.WriteLine("LastData is " + listItems.Last().TextItem);
#endif
// ObservableCollection の最後が ListView の Item と一致した時に ObservableCollection にデータを追加するなどの処理を行ってください。
if (listItems.Last() == e.Item as ListItem)
{
stack.IsVisible = true;
await Task.Delay(2000);
n++;
AddListItem(cellAmount * n);
stack.IsVisible = false;
}
};
Padding = new Thickness(0, Device.OnPlatform(20, 0, 0), 0, 0);
Content = new StackLayout
{
Children = {
list,
stack,
},
};
}
开发者ID:zcccust,项目名称:Study,代码行数:59,代码来源:ListViewPageCS.cs
示例17: MonkeyListPage
public MonkeyListPage()
{
var spinner = new ActivityIndicator();
spinner.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy");
spinner.SetBinding(ActivityIndicator.IsVisibleProperty, "IsBusy");
spinner.Color = Color.Blue;
var list = new ListView();
list.SetBinding(ListView.ItemsSourceProperty, "MonkeyList");
var cell = new DataTemplate(typeof(ImageCell));
cell.SetBinding(ImageCell.TextProperty, "Name");
cell.SetBinding(ImageCell.DetailProperty, "Location");
cell.SetBinding(ImageCell.ImageSourceProperty, "Image");
list.ItemTemplate = cell;
//listView
// --> ItemTemplate
// ----> DataTemplate
// -------> Cell
var getMonkeys = new Button
{
Text = "Get Monkeys"
};
getMonkeys.Clicked += async (sender, e) =>
{
try
{
await _viewModel.GetMonkeysAsync();
}
catch
{
DisplayAlert("Error", "No Monkeys Found :(", "OK");
}
};
list.ItemTapped += async (sender, e) =>
{
var detail = new MonkeyPage();
detail.BindingContext = e.Item;
await Navigation.PushAsync(detail);
list.SelectedItem = null;
};
Content = new StackLayout
{
Children =
{
spinner, list, getMonkeys
}
};
BindingContext = _viewModel;
}
开发者ID:frankcalise,项目名称:xamarin-nycmonkeys,代码行数:58,代码来源:MonkeyListPage.cs
示例18: MatchListPage
public MatchListPage ()
{
Title = "Match List";
busyIcon = new ActivityIndicator ();
matchData = new ObservableCollection<RobotMatch> ();
matchData.Add (new RobotMatch (1, null));
matchData.Add (new RobotMatch (2, null));
//This provides space between the iOS status bar and the rest of the page
this.Padding = new Thickness(0, Device.OnPlatform(20, 0, 0), 0, 0);
StackLayout stack = new StackLayout ();
stack.Spacing = 5;
listView = new ListView ();
listView.ItemTapped += (sender, e) => {
// do something with e.Item
((ListView)sender).SelectedItem = null; // de-select the row
};
listView.ItemSelected += (sender, e) => {
if (e.SelectedItem == null) {
return; // don't do anything if we just de-selected the row
}
// do something with e.SelectedItem
ParseObject ob = ((RobotMatch)e.SelectedItem).Data;
Navigation.PushAsync (new InterfacePage (ob));
((ListView)sender).SelectedItem = null; // de-select the row
};
DataTemplate template = new DataTemplate (typeof (RobotsCell));
template.SetBinding (RobotsCell.TextProperty, "MatchName");
template.SetBinding (RobotsCell.DetailProperty, "CreatedDate");
//Dont need since SelectedItem == MatchData
template.SetBinding (RobotsCell.CellParseDataProperty , "Data");
listView.ItemTemplate = template;
Button addMatchBtn = new Button ();
addMatchBtn.Text = "New Match";
addMatchBtn.TextColor = Color.White;
addMatchBtn.BackgroundColor = Color.Fuschia;
addMatchBtn.Clicked += (object sender, EventArgs e) => {
busyIcon.IsVisible = true;
busyIcon.IsRunning = true;
AddNewMatch();
};
listView.ItemsSource = matchData;
stack.Children.Add (busyIcon);
stack.Children.Add (addMatchBtn);
stack.Children.Add (listView);
this.Content = stack;
}
开发者ID:jonathandao0,项目名称:OfficialVitruvianApp,代码行数:57,代码来源:MatchListPage.cs
示例19: MyPage
public MyPage() {
// ActivityIndicator を生成する
var ac = new ActivityIndicator {
Color = Device.OnPlatform(Color.Black, Color.Default, Color.Default),
IsRunning = true, // 回転中
VerticalOptions = LayoutOptions.CenterAndExpand // 中央に配置する
};
// ActivityIndicatorのみをコンテンツとして配置する
Content = ac;
}
开发者ID:furuya02,项目名称:Xamarin.Forms.ViewSamples,代码行数:10,代码来源:App.cs
示例20: InitializeComponent
private void InitializeComponent()
{
this.LoadFromXaml(typeof(WelcomePage));
Logo = this.FindByName<Image>("Logo");
EntryTitle = this.FindByName<global::DRS.EntryTitle>("EntryTitle");
EntryTitle2 = this.FindByName<global::DRS.EntryTitle>("EntryTitle2");
loading = this.FindByName<ActivityIndicator>("loading");
sign = this.FindByName<global::DRS.pressButton>("sign");
signup = this.FindByName<global::DRS.pressButton>("signup");
}
开发者ID:eissa1201,项目名称:STC-DRS,代码行数:10,代码来源:WelcomePage.xaml.g.cs
注:本文中的Xamarin.Forms.ActivityIndicator类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论