Stepper【数値入力】

メモ

概要

  • 数値入力コントロール

主要プロパティ

  • 現在値:Value【現在値】
  • 範囲・増減値:Minimum【最小値】・Maximum【最大値】・Increment【増減値】
  • 位置:HorizontalOptions【水平方向レイアウト】・VerticalOptions【垂直方向レイアウト】

主要イベント

  • ValueChanged【現在値変更】

定義

名前空間: Xamarin.Forms (英語)

[Xamarin.Forms.RenderWith(typeof(Xamarin.Forms.Platform._StepperRenderer))]
public class Stepper : View, IElementConfiguration<Stepper>

継承RendereriOSAndroidAndroid
(AppCompat)
UWP
BindableObject
  Element
    VisualElement
      View
        Stepper
StepperRendererUIStepperLinearLayoutControl

コンストラクタ

public Stepper ()

public Stepper (Double min【最小値】, Double max【最大値】, Double val【現在値】, Double increment【増減値】)

プロパティ・フィールド

プロパティ・フィールドデフォルト値説明
Stepper (英語)
public Double Increment { get; set; }
public static readonly BindableProperty IncrementProperty
増減値
public Double Maximum { get; set; }
public static readonly BindableProperty MaximumProperty
最大値
public Double Minimum { get; set; }
public static readonly BindableProperty MinimumProperty
最小値
public Double Value { get; set; }
public static readonly BindableProperty ValueProperty
現在値
View (英語)
public IList<IGestureRecognizer> GestureRecognizers { get; }ジェスチャイベントのコレクション
public LayoutOptions HorizontalOptions { get; set; }
public static readonly BindableProperty HorizontalOptionsProperty
Fill水平方向レイアウト
Center中央揃え
CenterAndExpand中央揃え拡張
End右揃え
EndAndExpand右揃え拡張
Fill全体
FillAndExpand全体拡張
Start左揃え
StartAndExpand左揃え拡張
public Thickness Margin { get; set; } 2.0.0.0
public static readonly BindableProperty MarginProperty 2.0.0.0
マージン
public LayoutOptions VerticalOptions { get; set; }
public static readonly BindableProperty VerticalOptionsProperty
Fill垂直方向レイアウト
Center中央揃え
CenterAndExpand中央揃え拡張
End下揃え
EndAndExpand下揃え拡張
Fill全体
FillAndExpand全体拡張
Start上揃え
StartAndExpand上揃え拡張
VisualElement (英語)
public Double AnchorX { get; set; }
public static readonly BindableProperty AnchorXProperty
0.5座標変換の中心の水平位置 (0 ~ 1)
public Double AnchorY { get; set; }
public static readonly BindableProperty AnchorYProperty
0.5座標変換の中心の垂直位置 (0 ~ 1)
public Color BackgroundColor { get; set; }
public static readonly BindableProperty BackgroundColorProperty
背景色
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public Boolean Batched { get; } 2.0.0.0
(内部使用)
public IList<Behavior> Behaviors { get; } 1.3.0.0
public static readonly BindableProperty BehaviorsProperty 1.3.0.0
Behaviorのリスト
public Rectangle Bounds { get; }要素の境界
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public Boolean DisableLayout { get; set; } 2.0.0.0
(内部使用)
public Double Height { get; }
public static readonly BindableProperty HeightProperty
レンダリングの高さ
public Double HeightRequest { get; set; }
public static readonly BindableProperty HeightRequestProperty 1.3.0.0
高さ
public Boolean InputTransparent { get; set; }
public static readonly BindableProperty InputTransparentProperty
false入力透過有無
true:背後要素が入力受付
false:入力受付
public Boolean IsEnabled { get; set; }
public static readonly BindableProperty IsEnabledProperty
true有効無効
true:有効
false:無効
public Boolean IsFocused { get; }
public static readonly BindableProperty IsFocusedProperty 1.3.0.0
フォーカス有無
true:フォーカスあり
false:フォーカスなし
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public static readonly BindablePropertyKey IsFocusedPropertyKey 2.0.0.0
(内部使用)
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public Boolean IsInNativeLayout { get; set; } 2.0.0.0
(内部使用)
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public Boolean IsNativeStateConsistent { get; set; } 2.0.0.0
(内部使用)
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public Boolean IsPlatformEnabled { get; set; } 2.0.0.0
(内部使用)
public Boolean IsVisible { get; set; }
public static readonly BindableProperty IsVisibleProperty
true表示有無
true:表示
false:非表示
public Double MinimumHeightRequest { get; set; }
public static readonly BindableProperty MinimumHeightRequestProperty 1.3.0.0
-1最小の高さ
public Double MinimumWidthRequest { get; set; }
public static readonly BindableProperty MinimumWidthRequestProperty 1.3.0.0
-1最小の幅
public INavigation Navigation { get; }
public static readonly BindableProperty NavigationProperty
ナビゲーション インタフェース
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public NavigationProxy NavigationProxy { get; } 2.0.0.0
(内部使用)
public Double Opacity { get; set; }
public static readonly BindableProperty OpacityProperty
1.0不透明度 (0.0 ~ 1.0)
public ResourceDictionary Resources { get; set; }リソースディクショナリ
public Double Rotation { get; set; }
public static readonly BindableProperty RotationProperty
Z軸回りの回転
public Double RotationX { get; set; }
public static readonly BindableProperty RotationXProperty
X軸回りの回転
public Double RotationY { get; set; }
public static readonly BindableProperty RotationYProperty
Y軸回りの回転
public Double Scale { get; set; }
public static readonly BindableProperty ScaleProperty
1.0倍率
public Style Style { get; set; } 1.3.0.0
public static readonly BindableProperty StyleProperty 1.3.0.0
スタイル
[Xamarin.Forms.TypeConverter(typeof(Xamarin.Forms.ListStringTypeConverter))]
public IList<string> StyleClass { get; set; } 2.0.0.0
スタイルクラス
public Double TranslationX { get; set; } 1.2.0.0
public static readonly BindableProperty TranslationXProperty 1.2.0.0
水平方向移動
public Double TranslationY { get; set; } 1.2.0.0
public static readonly BindableProperty TranslationYProperty 1.2.0.0
垂直方向移動
public IList<TriggerBase> Triggers { get; } 1.3.0.0
public static readonly BindableProperty TriggersProperty 1.3.0.0
トリガーのリスト
public Double Width { get; }
public static readonly BindableProperty WidthProperty
レンダリングの幅
public Double WidthRequest { get; set; }
public static readonly BindableProperty WidthRequestProperty 1.3.0.0
public Double X { get; }
public static readonly BindableProperty XProperty
水平方向位置
public Double Y { get; }
public static readonly BindableProperty YProperty
垂直方向位置
Element (英語)
public String AutomationId { get; set; } 2.0.0.0オートメーションフレームワークId
public String ClassId { get; set; }
public static readonly BindableProperty ClassIdProperty
クラスId
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public IEffectControlProvider EffectControlProvider { get; set; } 2.0.0.0
(内部使用)
public IList<Effect> Effects { get; }視覚効果のリスト
public Guid Id { get; }Id
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public System.Collections.ObjectModel.ReadOnlyCollection<Element> LogicalChildren { get; } 2.0.0.0
(内部使用)
public static readonly BindableProperty MenuProperty 2.0.0.0メニュー
public Element Parent { get; set; }親要素
[System.Obsolete("ParentView is obsolete as of version 2.1.0. Please use Parent instead.")]
public VisualElement ParentView { get; } 2.1.0
親ビジュアル要素
(代替:Parent【親要素】)
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public IPlatform Platform { get; set; } 2.0.0.0
(内部使用)
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public Element RealParent { get; } 2.0.0.0
(内部使用)
public String StyleId { get; set; }スタイルId
BindableObject (英語)
public Object BindingContext { get; set; }
public static readonly BindableProperty BindingContextProperty
バインディングコンテキスト

メソッド

メソッド戻り値説明
Stepper (英語)
public IPlatformElementConfiguration<T, Stepper> On<T> () 2.0.0.0
where T : IConfigPlatform (Android・iOS・Windows)
プラットホーム固有インスタンスプラットホーム固有処理
View (英語)
protected override Void OnBindingContextChanged ()バインディングコンテキスト変更処理
VisualElement (英語)
public Void BatchBegin ()プロパティ変更のバッチ開始
public Void BatchCommit ()バッチコミット
public Boolean Focus ()フォーカス設定結果
true:設定
false:未設定
フォーカス設定
[System.Obsolete("OnSizeRequest is obsolete as of version 2.2.0. Please use OnMeasure instead.")]
public virtual SizeRequest GetSizeRequest 2.2.0
  (Double widthConstraint【幅】,
  Double heightConstraint【高さ】)
領域サイズ領域サイズ取得
(代替:OnMeasure)
protected virtual Void InvalidateMeasure ()レイアウト無効化
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public Void InvalidateMeasureNonVirtual 2.0.0.0
  (InvalidationTrigger trigger【内部使用】)
(内部使用)
public Void Layout
  (Rectangle bounds【要素領域】)
レイアウト更新
public SizeRequest Measure 2.0.0.0
  (Double widthConstraint【幅】,
  Double heightConstraint【高さ】,
  MeasureFlags flags【マージン追加フラグ】)
最小領域サイズ最小領域サイズ取得
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public Void NativeSizeChanged () 2.0.0.0
(内部使用)
protected override Void OnChildAdded 1.5.0.0
  (Element child【子要素】)
子要素追加処理
protected override Void OnChildRemoved 1.5.0.0
  (Element child【子要素】)
子要素削除処理
protected Void OnChildrenReordered ()子要素並べ替え処理
protected virtual SizeRequest OnMeasure 2.0.0.0
  (Double widthConstraint【幅】,
  Double heightConstraint【高さ】)
領域サイズレイアウト測定処理
protected override Void OnParentSet ()親要素設定処理
protected virtual Void OnSizeAllocated
  (Double width【幅】,
  Double height【高さ】)
要素領域サイズ設定処理
[System.Obsolete("OnSizeRequest is obsolete as of version 2.2.0. Please use OnMeasure instead.")]
protected virtual SizeRequest OnSizeRequest 2.2.0
  (Double widthConstraint【幅】,
  Double heightConstraint【高さ】)
領域サイズ領域サイズ測定処理
(代替:OnMeasure)
protected Void SizeAllocated
  (Double width【幅】,
  Double height【高さ】)
サブツリーレイアウト開始
public Void Unfocus ()フォーカス喪失
Element (英語)
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
[System.Runtime.CompilerServices.IteratorStateMachine(typeof(Xamarin.Forms.Element/<Descendants>d__85))]
public IEnumerable<Element> Descendants () 2.0.0.0
 (内部使用)
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public Boolean EffectIsAttached 2.0.0.0
  (String name【内部使用】)
 (内部使用)
public static Menu GetMenu 2.0.0.0
  (BindableObject bindable【バインディングオブジェクト】)
メニューオブジェクトメニュー取得
protected override Void OnBindingContextChanged ()バインディングコンテキスト変更処理
protected virtual Void OnChildAdded
  (Element child【子要素】)
子要素追加処理
protected virtual Void OnChildRemoved
  (Element child【子要素】)
子要素削除処理
protected virtual Void OnParentSet ()親要素設定処理
protected override Void OnPropertyChanged 2.0.0.0
  ([System.Runtime.CompilerServices.CallerMemberName] String propertyName【プロパティ名】)
プロパティ変更処理
public Void RemoveDynamicResource 1.3.0.0
  (BindableProperty property【プロパティ】)
動的リソース削除
public Void SetDynamicResource 1.3.0.0
  (BindableProperty property【プロパティ】,
  String key【動的リソースキー】)
動的リソース設定
public static Void SetMenu 2.0.0.0
  (BindableObject bindable【バインディングオブジェクト】,
  Menu menu【メニュー】)
メニュー設定
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public Void SetValueFromRenderer 2.0.0.0
  (BindableProperty property【内部使用】,
  Object value【内部使用】)
(内部使用)
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public Void SetValueFromRenderer 2.0.0.0
  (BindablePropertyKey property【内部使用】,
  Object value【内部使用】)
BindableObject (英語)
protected Void ApplyBindings () 2.0.0.0バインディング適用
protected Void ApplyBindings
  (Object oldContext)
public Void ClearValue
  (BindableProperty property【プロパティ】)
プロパティ値クリア
public Void ClearValue
  (BindablePropertyKey propertyKey【プロパティキー】)
public Object GetValue (BindableProperty property)プロパティ値プロパティ値取得
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public Object[] GetValues 2.0.0.0
  (BindableProperty property0【内部使用】,
  BindableProperty property1【内部使用】)
プロパティ値配列プロパティ値取得 (内部使用)
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public Object[] GetValues 2.0.0.0
  (BindableProperty property0【内部使用】,
  BindableProperty property1【内部使用】,
  BindableProperty property2【内部使用】)
public Boolean IsSet 2.0.0.0
  (BindableProperty targetProperty【プロパティ】)
  
protected virtual Void OnBindingContextChanged ()BindingContext 変更処理
protected virtual Void OnPropertyChanged
  ([System.Runtime.CompilerServices.CallerMemberName] String propertyName【プロパティ名】)
プロパティ変更後処理
protected virtual Void OnPropertyChanging
  ([System.Runtime.CompilerServices.CallerMemberName] String propertyName【プロパティ名】)
プロパティ変更前処理
public Void RemoveBinding
  (BindableProperty property【プロパティ】)
バインディング削除
public Void SetBinding
  (BindableProperty targetProperty【プロパティ】,
  BindingBase binding)
バインディング設定
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public static Void SetInheritedBindingContext
  (BindableObject bindable【オブジェクト】,
  Object value【継承コンテキスト】)
継承コンテキストネスト要素設定
public Void SetValue
  (BindableProperty property【プロパティ】,
  Object value【値】)
プロパティ値設定
public Void SetValue
  (BindablePropertyKey propertyKey【プロパティキー】,
  Object value【値】)
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public Void SetValueCore 2.0.0.0
  (BindableProperty property【内部使用】,
  Object value【内部使用】,
  SetValueFlags attributes【内部使用】)
(内部使用)
protected Void UnapplyBindings ()バインディング解除

イベント

イベント
EventHandler:(Object sender, EventArgs e)
説明
Stepper (英語)
public event EventHandler<ValueChangedEventArgs> ValueChanged

(object sender, ValueChangedEventArgs e)
  Double e.oldValue【変更前の値】
  Double e.newValue【変更後の値】
現在値変更
View
未定義
VisualElement (英語)
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public event EventHandler<Xamarin.Forms.Internals.EventArg<VisualElement>> BatchCommitted 2.0.0.0
(内部使用)
public event EventHandler ChildrenReordered子要素並べ替え
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public event EventHandler<VisualElement.FocusRequestArgs> FocusChangeRequested 2.0.0.0
(内部使用)
public event EventHandler<FocusEventArgs> Focusedフォーカス取得
public event EventHandler MeasureInvalidatedレイアウト無効
public event EventHandler SizeChangedサイズ変更
public event EventHandler<FocusEventArgs> Unfocusedフォーカス喪失
Element (英語)
public event EventHandler<ElementEventArgs> ChildAdded子要素追加
public event EventHandler<ElementEventArgs> ChildRemoved子要素削除
public event EventHandler<ElementEventArgs> DescendantAdded子要素サブツリー追加
public event EventHandler<ElementEventArgs> DescendantRemoved子要素サブツリー削除
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public event EventHandler PlatformSet 2.0.0.0
(内部使用)
BindableObject (英語)
public event EventHandler BindingContextChangedBindingContextプロパティ変更
public event PropertyChangedEventHandler PropertyChangedプロパティ変更後
public event PropertyChangingEventHandler PropertyChanging
プロパティ変更前

インタフェース

インタフェース戻り値説明
未定義
View
未定義
VisualElement (英語)
Void Xamarin.Forms.IVisualElementController.InvalidateMeasure 2.0.0.0
  (InvalidationTrigger trigger【内部使用】)
(内部使用)
Void Xamarin.Forms.IVisualElementController.NativeSizeChanged () 1.3.0.0 ~ 1.5.0.0要素のネイティブサイズ変更時の計測無効
Element (英語)
Void Xamarin.Forms.IElement.AddResourcesChangedListener 1.3.3.0 ~ 1.5.0.0
  (Action<object, ResourcesChangedEventArgs> onchanged【内部使用】)
(内部使用)
Object Xamarin.Forms.INameScope.FindByName 1.0.0.0 ~ 1.4.0.0
  (String name【要素id】)
要素オブジェクト登録要素検索
Object Xamarin.Forms.Internals.INameScope.FindByName 1.5.0.0
  (String name【内部使用】)
登録要素検索 (内部使用)
Void Xamarin.Forms.INameScope.RegisterName 1.2.0.0 ~ 1.2.0.0
  (String name【内部使用】,
  Lazy<object> scopedElement【内部使用】)
要素登録 (内部使用)
Void Xamarin.Forms.INameScope.RegisterName 1.0.0.0 ~ 1.4.0.0
  (String name【要素id】,
  Object scopedElement【登録要素】)
要素登録
Void Xamarin.Forms.Internals.INameScope.RegisterName 1.5.0.0
  (String name【内部使用】,
  Object scopedElement【内部使用】)
要素登録 (内部使用)
Void Xamarin.Forms.INameScope.RegisterName 1.4.0.0 ~ 1.4.0.0
  (String name【内部使用】,
  Object scopedElement【内部使用】,
  IXmlLineInfo xmlLineInfo【内部使用】)
要素登録 (内部使用)
[System.Obsolete]
Void Xamarin.Forms.Internals.INameScope.RegisterName 1.5.0.0
  (String name【内部使用】,
  Object scopedElement【内部使用】,
  IXmlLineInfo xmlLineInfo【内部使用】)
要素登録 (内部使用)
Void Xamarin.Forms.IElement.RemoveResourcesChangedListener 1.3.3.0 ~ 1.5.0.0
  (Action<object,
  ResourcesChangedEventArgs> onchanged【内部使用】)
(内部使用)
IResourceDictionary Xamarin.Forms.IElement.ResourceDictionary { get; } 1.3.0.0 ~ 1.3.0.0 (内部使用)
Void Xamarin.Forms.IElementController.SetValueFromRenderer 1.3.0.0
  (BindableProperty property【内部使用】,
  Object value【内部使用】)
(内部使用)
Void Xamarin.Forms.IElementController.SetValueFromRenderer 1.3.0.0 ~ 1.5.0.0
  (BindablePropertyKey property【内部使用】,
  Object value【内部使用】)
(内部使用)
Void Xamarin.Forms.INameScope.UnregisterName 1.0.0.0 ~ 1.4.0.0
  (String name【要素id】)
要素登録解除
Void Xamarin.Forms.Internals.INameScope.UnregisterName 1.5.0.0
  (String name【内部使用】)
要素登録解除 (内部使用)
WeakReference<Element> Xamarin.Forms.IElement.XamlParent { get; set; } 1.0.0.0 ~ 1.1.0.0 弱い参照の親要素
BindableObject (英語)
Void Xamarin.Forms.IDynamicResourceHandler.SetDynamicResource 1.4.0.0 ~ 1.4.0.0
  (BindableProperty property【内部使用】,
  String key【内部使用】)
(内部使用)
Void Xamarin.Forms.Internals.IDynamicResourceHandler.SetDynamicResource 1.5.0.0
  (BindableProperty property【内部使用】,
  String key【内部使用】)
(内部使用)

関連

<Stepper Value="50" Minimum="0" Maximum="100" Increment="10" HorizontalOptions="Start" VerticalOptions="Start" ValueChanged="OnStepperValueChanged" />

private void OnStepperValueChanged(object sender, ValueChangedEventArgs e)
{
    String msg = e.OldValue.ToString() + " → " + e.NewValue.ToString();
    DisplayAlert("OnStepperValueChanged", msg, "OK");
}