【发布时间】:2017-11-20 18:53:54
【问题描述】:
我对 Xamarin UWP 项目中的 ActivityIndicator 有疑问。指标一直在运行。我必须设置属性IsVisible 来隐藏指示器。我想在ActivityIndicator 上执行特定于平台的条件,并仅在平台为 Windows 时设置属性IsVisible。
这是我尝试过的:
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MyApp.Views.LoginPage">
<StackLayout Padding="10" Spacing="10">
<Label Text="User" />
<Entry Text="{Binding Email}" Placeholder="User" />
<Label Text="Pass" />
<Entry Text="{Binding Password}" Placeholder="Pass" />
<Button Text="Autentificare" />
<ActivityIndicator IsRunning="{Binding IsBusy}">
<OnPlatform x:TypeArguments="x:Boolean">
<On Platform="Windows" Value="IsVisible">{Binding IsBusy}</On>
</OnPlatform>
</ActivityIndicator>
</StackLayout>
</ContentPage>
我尝试使用OnPlatform 属性,但我不知道如何正确使用。有什么想法吗?
【问题讨论】:
标签: xamarin uwp xamarin.forms uwp-xaml