I would like you to help me solve a problem that I can not deal with.
In my Xamarin.Forms application, the user can add to the SQLite database:
public class Car
{
[PrimaryKey, AutoIncrement]
public int ID { get; set; }
public string Text { get; set; }
public int PickerValue { get; set; }
}
PickerValue is of type INT because I think that the selected value of the picker gives the index INT value. Am I wrong?
The user adds item using:
<Editor Placeholder="Enter name" Text="{Binding Text}" />
<Picker x:Name="myPicker" Title="Value:">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>value 1</x:String>
<x:String>value 2</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
On another page, items are displayed using ListView:
<Label Text="{Binding Text}"/>
<Label Text="{Binding PickerValue}"/>
When I select an item on the ListView - the edit page opens for me - the same page in which I added new products (code above) with filled fields from the database. I can edit them there.
I would like to be able to save the selected Picker value to SQLite, and on another page I can display it (or index of the selected value). Can someone help me how to make such a binding?
If it is possible - I would like to do it in XAML.
I made the project based on: https://docs.microsoft.com/pl-pl/xamarin/get-started/quickstarts/database?pivots=windows

