MultiTrigger クラス

定義

プロパティとバインド条件のリスト、およびリスト内のすべての条件が満たされたときに適用されるセッターのリストを表すクラス。

[Xamarin.Forms.ContentProperty("Setters")]
public sealed class MultiTrigger : Xamarin.Forms.TriggerBase
type MultiTrigger = class
    inherit TriggerBase
継承
属性

注釈

開発者が使用できる、MultiTriggerを使用してそれを含んでいるコントロールのプロパティ値と比較するTriggerオブジェクト、またはを使用してバインドされたプロパティ (の外側のコントロールを含む) についてBindingConditionオブジェクト。 これらを同じに混在させることができますConditions一覧。

XML の例以下では、適切なプロジェクトの名前空間で Xamarin.Forms アプリに追加すると、ユーザーがシークレットを入力し、シークレットが正しいかどうかを確認するためのスイッチを切り替えることを示す UI を作成します。 ユーザーは、「テキストの色は、緑色は、」を入力し、切り替える場合、Switchにその位置、次に、ユーザーが入力したテキスト、Entryが緑色にします。 スイッチが に切り替えるか、シークレット以外に、テキストが変更される場合、オフ配置には、既定の色にテキストを返します

<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:PropertyConditionDemo"
             x:Class="PropertyConditionDemo.PropertyConditionDemoPage">
<StackLayout VerticalOptions="Center">
<Label Text="Do you know the secret?"
               VerticalOptions="Center"
               HorizontalOptions="Center" />
<Entry Placeholder="Type the secret!"
               VerticalOptions="Center"
               HorizontalOptions="Center">
<Entry.Triggers>
<MultiTrigger TargetType="Entry" >
<MultiTrigger.Conditions>
<PropertyCondition Property="Text" Value="The text color is green" />
<BindingCondition Binding="{Binding Source={x:Reference checkSecret},
                                                            Path=IsToggled}"
                                          Value="true" />
</MultiTrigger.Conditions>
<Setter Property="TextColor"
                        Value="Color.Green" />
</MultiTrigger>
</Entry.Triggers>
</Entry>
<Label Text="Check the secret?"
               VerticalOptions="Center"
               HorizontalOptions="Center" />
<Switch x:Name="checkSecret"
                VerticalOptions="Center"
                HorizontalOptions="Center" />
</StackLayout>
</ContentPage>

コンストラクター

MultiTrigger(Type)

新しい MultiTrigger インスタンスを初期化します。

プロパティ

BindingContext

バインドされたプロパティのうち、この BindableObject に属するプロパティの対象となるプロパティが含まれるオブジェクトを取得または設定します。

(継承元 BindableObject)
Conditions

Setters リスト内のセッターが呼び出されるために満たされる必要がある条件のリストを取得します。

Dispatcher (継承元 BindableObject)
EnterActions

トリガー条件が満たされたときに呼び出される TriggerAction オブジェクトの一覧を取得します。 EventTrigger クラスの場合、無視されます。

(継承元 TriggerBase)
ExitActions

トリガー条件が満たされなくなった後に呼び出される TriggerAction オブジェクトの一覧を取得します。 EventTrigger クラスの場合、無視されます。

(継承元 TriggerBase)
IsSealed

トリガーが封印されているかどうかを示す値を取得します。

(継承元 TriggerBase)
Setters

Conditions プロパティの条件のリストがすべて満たされたときに適用される Setter オブジェクトのリストを取得します。

TargetType

この TriggerBase オブジェクトを添付できるオブジェクトの型。

(継承元 TriggerBase)

メソッド

ApplyBindings()

BindingContext にバインディングを適用します。

(継承元 BindableObject)
ClearValue(BindableProperty)

propertySetValue によって設定された値を消去します。

(継承元 BindableObject)
ClearValue(BindablePropertyKey)

propertyKey によって識別されるプロパティの SetValue によって設定される値を消去します。

(継承元 BindableObject)
CoerceValue(BindableProperty) (継承元 BindableObject)
CoerceValue(BindablePropertyKey) (継承元 BindableObject)
GetValue(BindableProperty)

BindableProperty に含まれる値を返します。

(継承元 BindableObject)
GetValues(BindableProperty, BindableProperty)
互換性のために残されています。

Xamarin.Forms プラットフォームによる内部使用向け。

(継承元 BindableObject)
GetValues(BindableProperty, BindableProperty, BindableProperty)
互換性のために残されています。

Xamarin.Forms プラットフォームによる内部使用向け。

(継承元 BindableObject)
IsSet(BindableProperty)

ターゲット プロパティが存在し、設定されている場合、true を返します。

(継承元 BindableObject)
OnBindingContextChanged()

このメソッドをオーバーライドし、BindingContext が変更されたときにアクションを実行します。

(継承元 BindableObject)
OnPropertyChanged(String)

子クラスからこのメソッドを呼び出し、プロパティが変更されたことを通知します。

(継承元 BindableObject)
OnPropertyChanging(String)

子クラスからこのメソッドを呼び出し、プロパティで変更が行われることを通知します。

(継承元 BindableObject)
RemoveBinding(BindableProperty)

以前に設定されたバインディングを削除します。

(継承元 BindableObject)
SetBinding(BindableProperty, BindingBase)

プロパティにバインディングを割り当てます。

(継承元 BindableObject)
SetValue(BindableProperty, Object)

指定したプロパティの値を設定します。

(継承元 BindableObject)
SetValue(BindablePropertyKey, Object)

propertyKey の値を設定します。

(継承元 BindableObject)
SetValueCore(BindableProperty, Object, SetValueFlags)

Xamarin.Forms プラットフォームによる内部使用向け。

(継承元 BindableObject)
UnapplyBindings()

以前に設定されたバインディングをすべて解除します。

(継承元 BindableObject)

イベント

BindingContextChanged

BindingContext プロパティが変更されるたびに発生します。

(継承元 BindableObject)
PropertyChanged

プロパティが変更されたときに発生します。

(継承元 BindableObject)
PropertyChanging

プロパティが変更されようとしているときに発生します。

(継承元 BindableObject)

明示的なインターフェイスの実装

IDynamicResourceHandler.SetDynamicResource(BindableProperty, String)

Xamarin.Forms プラットフォームによる内部使用向け。

(継承元 BindableObject)

拡張メソッド

GetPropertyIfSet<T>(BindableObject, BindableProperty, T)
SetAppThemeColor(BindableObject, BindableProperty, Color, Color)
SetBinding(BindableObject, BindableProperty, String, BindingMode, IValueConverter, String)

プロパティにバインドを作成し、適用します。

SetBinding<TSource>(BindableObject, BindableProperty, Expression<Func<TSource,Object>>, BindingMode, IValueConverter, String)
互換性のために残されています。

式からバインドを作成し適用します。

SetOnAppTheme<T>(BindableObject, BindableProperty, T, T)

適用対象

こちらもご覧ください