Firstly I apologise; my knowledge of xamarin and c# is non-existent therefore I'm going to butcher the terminology here.
My view "OrderReturnView.xaml" looks like this;
The plus (+) button for each line is defined as per;
OrderReturnView.xaml;
<!-- PLUS BUTTON -->
<Button
Grid.Row="0" Grid.Column="6"
IsVisible="{Binding IsPlusButtonEnabled}"
IsEnabled="{Binding IsActionable}"
Style="{StaticResource PlusMinusButton}" Text="+"
Command="{Binding Path=BindingContext.PlusCommand, Source={x:Reference Name=ThisPage}}"
CommandParameter="{Binding .}"/>
ReturnViewModel.cs;
Upon clicking "+" the "obj" passed to the command is the specific line that had the "+" clicked;
I added "ShowReturnReasonCodeDialog" to the plus command - this just sets the "IsVisible" bound bools to "true" to display the reason code selection popup. The user then selects a reason code from a drop down and clicks confirm.
Excerpt of the popup definitions, specifically the "confirm" button which is what I'm having problems with;
OrderReturnView.xaml (added a template with visibility controlled via a bool value);
<!-- RETURN REASON CODE SELECTION POPUP GRID -->
<templates:ReturnReasonCodeDialog
Grid.Column="0"
Grid.Row="0"
Grid.ColumnSpan="3"
Grid.RowSpan="7"
IsVisible="{Binding ReturnReasonCodePopupVisibility}" />
ReturnReasonCodeDialog.xaml template the popup's "confirm" button definition;
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:i18n="clr-namespace:Xfulfilment.Helpers;assembly=Xfulfilment"
x:Class="Xfulfilment.Templates.ReturnReasonCodeDialog"
x:Name="ThisPage">
...
<Button IsEnabled="{Binding IsActionable}"
Style="{StaticResource AcceptButton}"
Text="{i18n:Translate confirm_button}"
Padding="0,0,0,0"
Margin="5,0,10,0"
VerticalOptions="Center"
HorizontalOptions="Start"
Command="{Binding Path=BindingContext.ConfirmReasonCodePopupCommand, Source={x:Reference Name=ThisPage}}"
CommandParameter="{Binding .}"/>
ViewModel;
The issue here is that when "confirm" is clicked the data passed to "obj" is the entire collection of lines;
Whereas I just want the line that had the "+" clicked on it just before the popup was shown. I am guessing the problem here is something to do my Command/CommandParameter definitions for the confirm button however having had a read up on them I'm still unsure what I need to do - any ideas?