私はスイッチとTextInputEditTextを持っています。 「Enabled」と「Enabled」の両方が、ビューモデル内の同じフィールドにバインドされています。Mvvmcross Android TextInputEditText Binding Enabled
アクティビティが読み込まれると、バインドされたフィールドはfalseに設定されます。スイッチは期待どおりに無効になっています。ただし、TextInputEditTextは有効です。 'Clickable'にも同じ問題があります。テキストは正常にバインドされています。
バインドされたフィールドをtrueに変更してからfalseに変更すると、TextInputEditText Enable & Clickableが正しく動作します。それが最初に読み込まれるときにのみ発生するようです。
<android.support.v7.widget.SwitchCompat
style="@style/EntryTextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
local:MvxLang="Text LabelDeferArrivalNotice"
local:MvxBind="Checked RouteMarker.DeferArrivalNotice; Enabled RouteMarker.ArrivalNotice" />
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="@+id/edittext_route_marker_EffectiveFromDateTime"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:editable="false"
android:focusableInTouchMode="false"
style="@style/EntryTextStyle"
local:MvxLang="Hint LabelEffectiveFromTime"
local:MvxBind="Text DateTimeToString(RouteMarker.EffectiveFromDateTime);
Enabled RouteMarker.ArrivalNotice;
Clickable RouteMarker.ArrivalNotice;
Click PromptDeferTimeCommand" />
TextInputEditTextと特別なことはありますか?
おかげ
'TextInputEditText'に特別なことをする必要はありません。 'RouteMarker.ArrivalNotice'がメインスレッド以外のスレッドから設定されている可能性はありますか? –
この問題は、特にEditTextではなく、Clickをバインドすることに関連していることがわかりました。私はそれのための新しい投稿を作成しました:https://stackoverflow.com/questions/47668130/mvvmcross-android-binding-enabled-not-work-with-click – Nick