I am working on a UWP application and I am trying to do something with the values of a SelectedItem in a GridView. So as I usually do with WPF I went into the XAML and Typed my event name in the XAML and let VS create the event in code for me.
<GridView x:Name="DataGrid1"
ItemClick="dg_ItemClick">
<!-- Just -->
<!-- Some -->
<!-- Normal -->
<!-- XAML -->
</GridView>
and the VS created event looks like this
private void dg_ItemClick(object sender, Windows.UI.Xaml.Controls.ItemClickEventArgs e)
{
Biz.Customer cust = e.ClickedItem as Biz.Customer;
var messageDialog2 = new MessageDialog(cust.Code, cust.Company);
messageDialog2.ShowAsync();
}
Right away I get a red squiggly line under the UI in the Windows.UI.Xaml.Controls part. There is a using at the top of the page to include that and VS wouldn't let add any other UWP references.
I can get the error to go away as I have in other parts of the application by changing the ItemClickEventArgs to RoutedEvenArgs but in this case I really need the ClickedItem as an argument to be passed to the code behind.
I have just talked to someone else getting started with UWP and they said they are having the same issue on other cLick events. So are we both doing something wrong or is there something missing from our application that is needed for the UI to be recognized?
The full error I am getting is this: Error CS0234 The type or namespace name 'UI' does not exist in the namespace 'app name' (are you missing an assembly reference?)