VB.NET, C#, PowerShellを使用しているエンジニアのためのサイト。
基本的な使用方法から開発で役立つTipsまで幅広く取り扱っています。
Update 2019/01/03
Next Tips>
<Stepper x:Name="stepper1" Value="50" />
コードでStepperコントロールに現在値を設定するには、以下のようにします。
namespace stepperSample01
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
// Stepperの現在値を50に設定
stepper1.Value = 50;
}
}
}
<Stepper x:Name="stepper1" Value="50" />
<!-- Stepperの現在値を表示 -->
<Label Text="{Binding Source={x:Reference stepper1}, Path=Value, StringFormat='{0:F0}'}"
HorizontalOptions="Center"
VerticalOptions="CenterAndExpand" />
コードでStepperコントロールの現在値を取得してLabelに表示する例を以下に示します。
namespace stepperSample01
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
// Stepperの現在値を50に設定
stepper1.Value = 50;
}
}
}
実行例を以下に示します。