了解 Cross-Platform App 如何启动和使用 xaml 个页面
Understanding how Cross-Platform App starts and uses xaml pages
(我有 MVC、WebForms、WinForms 方面的经验。我正在开始跨平台应用程序项目。)
我创建了一个包含 Xamarin.Forms 的跨平台应用程序项目。
Visual Studio 创建了 4 个子项目:
"MyProject"
"MyProject".Android
"MyProject".iOS
"MyProject".UWP
我想我实际上必须在 "MyProject" 中开发我的大部分项目,除了 UI 特定的东西?
那我有两个问题:
- "MyProject".UWP 里面写的是要显示"MyProject"\MainPage.xaml?
- 为什么我无法在设计器模式下查看 "MyProject"\MainPage.xaml?
我想我找到了两个答案:
Where is it written in "MyProject".UWP that it has to display
"MyProject"\MainPage.xaml?
"MyProject".UWP\MainPage.xaml.cs 的某处是行 MainPage = new MyProject.App();
和 "MyProject".UWP\App.xaml.cs 是 MainPage = new MyProject.MainPage();
(对于那些不习惯使用 XAML 文件的人:.cs 代码可以在查看器中单击 XAML 文件左侧的箭头。)
Why can't I view "MyProject"\MainPage.xaml in designer mode?
根据https://developer.xamarin.com/guides/xamarin-forms/troubleshooting/questions/forms-xaml-designer/
可能的答案:"There is not yet a visual designer for generating XAML in Xamarin.Forms applications, so all XAML must be hand-written."
(我有 MVC、WebForms、WinForms 方面的经验。我正在开始跨平台应用程序项目。)
我创建了一个包含 Xamarin.Forms 的跨平台应用程序项目。 Visual Studio 创建了 4 个子项目: "MyProject" "MyProject".Android "MyProject".iOS "MyProject".UWP
我想我实际上必须在 "MyProject" 中开发我的大部分项目,除了 UI 特定的东西?
那我有两个问题:
- "MyProject".UWP 里面写的是要显示"MyProject"\MainPage.xaml?
- 为什么我无法在设计器模式下查看 "MyProject"\MainPage.xaml?
我想我找到了两个答案:
Where is it written in "MyProject".UWP that it has to display "MyProject"\MainPage.xaml?
"MyProject".UWP\MainPage.xaml.cs 的某处是行 MainPage = new MyProject.App();
和 "MyProject".UWP\App.xaml.cs 是 MainPage = new MyProject.MainPage();
(对于那些不习惯使用 XAML 文件的人:.cs 代码可以在查看器中单击 XAML 文件左侧的箭头。)
Why can't I view "MyProject"\MainPage.xaml in designer mode?
根据https://developer.xamarin.com/guides/xamarin-forms/troubleshooting/questions/forms-xaml-designer/ 可能的答案:"There is not yet a visual designer for generating XAML in Xamarin.Forms applications, so all XAML must be hand-written."