Merge commit '42d0682b943d57dd20095c820d58a178494af593' into tvOS

This commit is contained in:
Martijn van Dijk 2016-10-13 18:56:52 +02:00
Родитель 2572f7792d 42d0682b94
Коммит 23f6dfb8e4
3 изменённых файлов: 23 добавлений и 0 удалений

Просмотреть файл

@ -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();
}
}
}