我有一个基于 FreshMvvm 构建的简单项目,并且只有一个实体,Contact
具有 2 个字符串属性,Name
并且Number
.
该应用程序显示联系人列表,当用户点击联系人时,它会打开ContactPage.xaml
带有联系人详细信息的联系人。
该应用程序工作正常,但我想将 , 的名称更改为ContactPage.xaml
,在这种情况下,当 FreshMvvm在打开联系方式ContactDetailsPage.xaml
时尝试查找时,它会失败。ContactPage.xaml
我如何告诉 FreshMvvm 寻找ContactDetailsPage.xaml
而不是ContactPage.xaml
?
ContactListPage.xaml 如下所示:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="FreshMvvmDemo.Pages.ContactListPage">
<ContentPage.Content>
<StackLayout>
<Label Text="{Binding MainText}" VerticalOptions="Center" HorizontalOptions="Center" />
<ListView ItemsSource="{Binding ContactList}" SelectedItem="{Binding SelectedContact}">
<ListView.ItemTemplate>
<DataTemplate>
<TextCell Text="{Binding Name}" Detail="{Binding Number}"></TextCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentPage.Content>
</ContentPage>
ContactPage.xaml 如下所示:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="FreshMvvmDemo.Pages.ContactPage">
<ContentPage.Content>
<StackLayout>
<Entry Text="{Binding Contact.Name}"></Entry>
<Entry Text="{Binding Contact.Number}"></Entry>
</StackLayout>
</ContentPage.Content>
</ContentPage>