Q:

make Xamarin DisplayActionSheet select, display value in Label

I have wired up my ContentPage to an instance of a class (g), and this case works fine:

open the page
enter values in the Entry boxes
make a selection from a DisplayActionSheet
click Save

OnSave all the values from the UI are in g, but the value from the DisplayActionSheet is not in the UI where I expect it.
After the DisplayActionSheet thing runs, I want a value for AisleDepthText to display in the UI.
Here is the class that I instantiate into a variable, g
public class GroceryItemForSaving
{
    public GroceryItemForSaving() { }
    public event PropertyChangedEventHandler PropertyChanged;
    private string _AisleDepth;
    public string AisleDepth
    {
        get
        {
            return _AisleDepth;
        }
        set
        {
            _AisleDepth = value;
            OnPropertyChanged();
        }
    }
    private string _AisleDepthText;
    public string AisleDepthText
    {
        get
        {
            return _AisleDepthText;
        }
        set
        {
            _AisleDepthText = value;
            OnPropertyChanged();
        }
    }
    protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
    {
        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
    }
}

I make g the BindingContext like this:
public NewGrocery()
{
    InitializeComponent();
    BindingContext = g;
}

Here is the relevant XAML.
<Label Text="GroceryName" Grid.Row="0" Grid.Column="1" ></Label>
<Entry Text="{Binding GroceryName}" Grid.Row="0" Grid.Column="2" ></Entry>

<Label Text="Aisle" Grid.Row="1" Grid.Column="1" ></Label>
<Entry Text="{Binding Aisle}" Grid.Row="1" Grid.Column="2"></Entry>

<Label Text="Aisle Depth" Grid.Row="2" Grid.Column="1" ></Label>
<Label Text="{Binding AisleDepthText, Mode=OneWay}" Grid.Row="2" Grid.Column="2" ></Label>
<Button Clicked="ShowAisleDepthChoices" Grid.Row="2" Grid.Column="3" Text="Aisle Depth" ></Button>

The button click handler ShowAisleDepthChoices, makes the ActionSheet display. In the code for that I set the values for AisleDepth and AisleDepthText like this:
public async void ShowAisleDepthChoices(object sender, EventArgs e)
{
    var AisleDepth = 0;
    var SelectedAisleDepth = await DisplayActionSheet("Aisle Depth", "Cancel", null, "Front", "Middle", "Back", "Back Wall");
    switch (SelectedAisleDepth)
    {
        case "Front":
            AisleDepth = 1;
            break;
        case "Middle":
            AisleDepth = 2;
            break;
        case "Back":
            AisleDepth = 3;
            break;
        case "Back Wall":
            AisleDepth = 4;
            break;
    }
    g.AisleDepthText = SelectedAisleDepth;
    g.AisleDepth = AisleDepth.ToString();
}

Then after that no value appears in AisleDepthText Label, but when I click Save, the values are in g.AsileDepthText and g.AisleDept exactly where I expect them.  NOTE: I can enter a GroceryName directly in the UI and it ends up in g.GroceryName on save.
What do I need to do to make the value for g.AisleDepthText appear in the UI after the DisplayActionSheet does its thing?

A:

GroceryItemForSaving needs to implement INotifyPropertyChanged.  You have to code to satisfy the implementation, but you're not declaring that the class uses the interface, so your binding isn't updating like it should.
public class GroceryItemForSaving : INotifyPropertyChanged

