【发布时间】:2016-06-30 16:51:28
【问题描述】:
我试图显示ActivityIndicator 在我尝试更新数据库上的列字段时按下按钮后,它没有出现?有什么问题?
关于以下我的代码:
ActivityIndicator ai = new ActivityIndicator()
{
HorizontalOptions = LayoutOptions.CenterAndExpand,
Color = Color.Black
};
ai.IsRunning = true;
ai.IsEnabled = true;
ai.BindingContext = this;
ai.SetBinding(ActivityIndicator.IsVisibleProperty, "IsBusy");
ProcessToCheckOut = new Button { Text = "Set Inf" };
ProcessToCheckOut.Clicked += (object sender, EventArgs e) =>
{
this.IsBusy = true;
UserUpdateRequest user=new UserUpdateRequest();
user.userId = CustomersPage.ID;
appClient.UpdateInfo(user);
this.IsBusy = false;
Navigation.PushAsync(new CheckoutShippingAddressPage(appClient));
};
Content = new StackLayout
{
Children={
tb,
ai,
ProcessToCheckOut
}
};
【问题讨论】:
-
您是如何定义 IsBusy 的?它是可绑定属性吗?
-
ProcessToCheckOut 是按钮.. 我应该添加一个属性吗?!
-
@StarterPack IsBusy 是内置的。它用于打开和关闭状态栏活动图标 - 但您也可以在自己的代码中使用它,就像在这里完成的那样
标签: c# xamarin xamarin.forms portable-class-library