Quantcast
Viewing all articles
Browse latest Browse all 77050

Can't get the Picker element

Xamarin forms
So I'm new with the mvvm I was trying to get the string of the picker so when I go to the next Page it will show me the selected element.

In the axml file is like this,
<Picker x:Name="picker"
Grid.Row="0"
Grid.Column="1"
SelectedItem="{Binding Option, Mode=TwoWay}"
TextColor="White"
>

and in the Binded .cs file
private string _Option;
public string Option
{
get { return _Option; }
set {
if(this._Option != value)
{
this._Option = value;
PropertyChanged?.Invoke(
this,
new PropertyChangedEventArgs(nameof(this.Option)));
} }
}`

And what I want to do after this
MainViewModel.GetInstance().Apps = new AppViewModel();

        await Application.Current.MainPage.Navigation.PushAsync(new AppPage());`

Is to get the public string Option and then set it in a label in "new AppPage"(another page).
How can I do this?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>