0
나는 TabbedPage
을 가지고 있으며, 의도 한 것은 json ListView
을 MainPage 아래 ContentPage
으로 스트리밍하는 것입니다.'AppName.MyListItem'형식을 'AppName.MySecundPage.MyListItem'형식으로 암시 적으로 변환 할 수 있습니까?
내가 이해할 수있는 한, xaml로 변환 할 때 손실이 발생합니다.
누구든지 나를 도와 줄 수 있습니까?
내 코드는 다음과 같습니다
내 C# 파일
void OnListViewItemSelected(object sender, SelectedItemChangedEventArgs eventInfo)
{
if (eventInfo.SelectedItem != null)
{
cityItem clickedCityName = (cityItem)eventInfo.SelectedItem;
System.Diagnostics.Debug.WriteLine(clickedCityName.cityAddress);
citiesListView.SelectedItem = null;
SingelCityPage pcity = new SingelCityPage();
pcity.currentCity = clickedCityName;
//Looks like I am missing something here but I don't find any reference.
//or is in the XML that its missing the connection?
Navigation.PushAsync(pcity);
}
}
내 XAML
당신의 코드베이스에서<ContentPage.Content>
<StackLayout>
<ListView x:Name="citiesListView">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.ContextActions>
<AbsoluteLayout Padding="10,10,10,10">
<Label Text="{Binding cityName}" AbsoluteLayout.LayoutBounds="0.0, 0.0, 0.75, 0.5" AbsoluteLayout.LayoutFlags="All" />
<Label Text="{Binding cityLocation}" AbsoluteLayout.LayoutBounds="0.0, 1.0, 0.75, 0.5" AbsoluteLayout.LayoutFlags="All" />
<Label Text="{Binding cityAdress}" AbsoluteLayout.LayoutBounds="1.0, 0.0, 0.5, 1.0" AbsoluteLayout.LayoutFlags="All" />
</AbsoluteLayout>
</ViewCell.ContextActions>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentPage.Content>
이 에러가 발생합니까 :
붙여 넣은 조각이 도움이되지 않기 때문에, 나는 문제가이 라인에서 발생 말하고 싶지만, 다시 추측? 제목에 언급 된 유형을 사용하는 곳은 어디에도 없습니다. 이 _relevant_ 코드를 게시 한 것 같지 않습니다. – Cheesebaron