Skip to content

Commit

Permalink
Update Button.Text property on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
jessejiang0214 committed Aug 22, 2016
1 parent 34723a9 commit 1f2479a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Droid/Renderers/BindablePickerRendererDroid.cs
Expand Up @@ -14,7 +14,7 @@
[assembly: ExportRenderer(typeof(BindablePicker), typeof(FreshEssentials.Droid.BindablePickerRendererDroid))]
namespace FreshEssentials.Droid
{
public class BindablePickerRendererDroid : ViewRenderer<Picker, AButton>
public class BindablePickerRendererDroid : ViewRenderer<BindablePicker, AButton>
{
AlertDialog _dialog;

Expand All @@ -36,7 +36,7 @@ protected override void Dispose(bool disposing)
base.Dispose(disposing);
}

protected override void OnElementChanged(ElementChangedEventArgs<Picker> e)
protected override void OnElementChanged(ElementChangedEventArgs<BindablePicker> e)
{
if (e.OldElement != null)
((ObservableCollection<string>)e.OldElement.Items).CollectionChanged -= RowsCollectionChanged;
Expand Down Expand Up @@ -118,7 +118,10 @@ void RowsCollectionChanged(object sender, EventArgs e)

void UpdatePicker()
{
Control.Hint = Element.Title;
if (Element.SelectedIndex < 0)
Control.Text = Element.Title;
else
Control.Text = Element.Items[Element.SelectedIndex];
}

class PickerListener : Object, IOnClickListener
Expand Down

0 comments on commit 1f2479a

Please sign in to comment.