waslibs icon indicating copy to clipboard operation
waslibs copied to clipboard

Can't use x:Bind

Open yeejmeem opened this issue 8 years ago • 1 comments

Why new version removed x:Bind in TextDetailLayout and YouTubeDetailLayout? Before, old version use x:Bind, i can get some info in code beind: Example: var messageDialog = new MessageDialog(ViewModel.SelectedItem.Content); await messageDialog.ShowAsync(); But now, with Binding, i can't use it in code behind, if use i will have error: if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break(); How to resolve? I'm beginner, and sorry for my bad english.

yeejmeem avatar Jun 29 '16 07:06 yeejmeem

In your case it should affect to have bind or binding, the property is available anyway. The only thing it could happen is that the SelectedItem is not set when you are trying to access to Content property. We are setting the selected item in the Navigated Page event, so you need to be sure that is not null before trying to access its content.

javitosanchez avatar Jun 30 '16 15:06 javitosanchez