I am trying to set the binding of the text of a text field inside a popup, but my setmodel parameter for the related property is never called. I have a view setup as follows:
<CommandBar>
<AppBarButton Icon="Edit" AllowFocusOnInteraction="true">
<Flyout>
<StackPanel>
<TextBlock Text="Enter Qty:" />
<TextBox Text="{Binding EditQty, Mode=TwoWay}" InputScope="Number" />
<Button Content="Update" Command="{Binding EditCommand}" />
</StackPanel>
</Flyout>
<CommandBar>
My viewmodel code is also simple:
public decimal _editQty;
public decimal EditQty
{
get => _editQty;
set => Set(ref _editQty, value);
}
I even tried using UpdateSourceTrigger = Explicitly with the binding, and then in the button click event, setup codebehind to call
textBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
During debugging, I see that the value of textBox.Text has changed correctly, but the installer is still not called UpdateSource (). I am using Windows 10 Build 14393 (Anniversary Edition), if that matters.
Is there any way to do this? At this point, I will have to give up the idea and place the text box in the dialog box, even if it were in the pop-up window it would be better than the user.