Merge commit '42d0682b943d57dd20095c820d58a178494af593' into tvOS
This commit is contained in:
Коммит
23f6dfb8e4
|
@ -81,6 +81,7 @@
|
|||
<Compile Include="ResourceHelpers\MvxAndroidBindingResource.cs" />
|
||||
<Compile Include="ResourceHelpers\MvxAppResourceTypeFinder.cs" />
|
||||
<Compile Include="Resources\Resource.Designer.cs" />
|
||||
<Compile Include="Target\MvxListPreferenceTargetBinding.cs" />
|
||||
<Compile Include="Target\MvxTextViewHintTargetBinding.cs" />
|
||||
<Compile Include="Target\MvxEditTextPreferenceTextTargetBinding.cs" />
|
||||
<Compile Include="Target\MvxExpandableListViewSelectedItemTargetBinding.cs" />
|
||||
|
|
|
@ -142,6 +142,9 @@ namespace MvvmCross.Binding.Droid
|
|||
registry.RegisterCustomBindingFactory<EditTextPreference>(
|
||||
"Text",
|
||||
preference => new MvxEditTextPreferenceTextTargetBinding(preference));
|
||||
registry.RegisterCustomBindingFactory<ListPreference>(
|
||||
"Value",
|
||||
preference => new MvxListPreferenceTargetBinding(preference));
|
||||
registry.RegisterCustomBindingFactory<TwoStatePreference>(
|
||||
"Checked",
|
||||
preference => new MvxTwoStatePreferenceCheckedTargetBinding(preference));
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
using Android.Preferences;
|
||||
|
||||
namespace MvvmCross.Binding.Droid.Target
|
||||
{
|
||||
public class MvxListPreferenceTargetBinding : MvxPreferenceValueTargetBinding
|
||||
{
|
||||
public MvxListPreferenceTargetBinding(Preference preference)
|
||||
: base(preference)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void SetValueImpl(object target, object value)
|
||||
{
|
||||
var pref = target as ListPreference;
|
||||
if (pref != null)
|
||||
pref.Value = value.ToString();
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче