的 XAML 热重载 Xamarin.FormsXAML Hot Reload for Xamarin.Forms
03/14/2020
本文内容
XAML 热重载将插入现有的工作流,以提高工作效率并节省时间。XAML Hot Reload plugs into your existing workflow to increase your productivity and save you time. 如果不使用 XAML 热重载,则必须在每次想要查看 XAML 更改时生成并部署应用。Without XAML Hot Reload, you have to build and deploy your app every time you want to see a XAML change. 如果是热重载,则保存 XAML 文件时,所做的更改将反映在正在运行的应用程序中。With Hot Reload, when you save your XAML file the changes are reflected live in your running app. 此外,还将保留你的导航状态和数据,从而使你可以快速循环访问 UI,而不会丢失你在应用中的位置。In addition, your navigation state and data will be maintained, enabling you to quickly iterate on your UI without losing your place in the app. 因此,通过 XAML 热重载,你将花费更少的时间来重新生成和部署应用,以验证 UI 更改。Therefore, with XAML Hot Reload, you'll spend less time rebuilding and deploying your apps to validate UI changes.
备注
If you're writing a WPF or UWP app, see XAML Hot Reload for UWP and WPF.
的 XAML 热重载 Xamarin.Forms 当前 不适 用于 Xamarin.Forms UWP 项目。XAML Hot Reload for Xamarin.Forms does not currently work for Xamarin.Forms UWP projects.
系统要求System requirements
IDE/框架IDE/Framework
所需版本Version Required
Visual Studio 2019Visual Studio 2019
16.4 或更高版本16.4 or greater
Visual Studio 2019 for MacVisual Studio 2019 for Mac
8.4 或更高版本8.4 or greater
Xamarin.Forms
4.1 或更高版本4.1 or greater
为启用 XAML 热重载 Xamarin.FormsEnable XAML Hot Reload for Xamarin.Forms
如果从模板开始,则默认情况下将启用 XAML 热重载,并将项目配置为不使用其他设置。If