Posted 6 September 2021, 11:28 pm EST
Hi,
maybe i am only brick in front of my head but it didn’t work as expected.
I have a C1ComboBox in my Xamarin Forms App:
Declared in the Xaml :
<c1:C1ComboBox x:Name="combComments" Margin="10,0,10,0"
Text="{Binding CombCommentText}"
IsEditable="True"
VerticalOptions="Start"
DropDownWidth="250"
DropDownMode="ForceAbove"
IsVisible="{Binding CombCommentVisible}">
<c1:C1ComboBox.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>No Outbound (see Load)</x:String>
<x:String>Cont. steht am W11</x:String>
<x:String>No Outbound - Weps</x:String>
<x:String>Overflow to (see Load)</x:String>
<x:String>INB Freight West</x:String>
<x:String>Others:</x:String>
</x:Array>
</c1:C1ComboBox.ItemsSource>
<c1:C1ComboBox.Behaviors>
<b:EventToCommandBehavior EventName="SelectedIndexChanged" Command="{Binding CombUldInfoSelectedIndexChangedCommand}"
CommandParameter="{Binding Source={x:Reference combComments}, Path=Text}" />
</c1:C1ComboBox.Behaviors>
In my Page View model i have the Property as follows:
public string CombCommentText
{
get { return _combCommentText; }
set
{
if (value == _combCommentText)
return;
SetProperty(ref _combCommentText, value);
}
}
But when i want to read the actual value displayed in the combobox i only get an empty string back.
Can you help me what is wrong there.
Rgds
Sascha