gpt4 book ai didi

forms - Xamarin Forms XAML 设计实例

转载 作者:行者123 更新时间:2023-12-04 17:34:13 26 4
gpt4 key购买 nike

有没有办法在 Xamarin Forms XAML 页面中启用设计上下文以启用智能感知?它在 WPF 中工作,但多年来我无法让它在 Xamarin Forms 中工作。

最佳答案

因此,如果您通过在代码中某处设置属性来编译您的 xaml,然后包含下面的 xaml 片段,您可以使用设计时数据上下文并获得智能感知。

[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
namespace MySpace
{
public partial class App {}
}

<Page
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d ="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=list:TestViewModel}"
xmlns:list="clr-namespace:PolyhydraGames.Test.ViewModels"
.../>

关于forms - Xamarin Forms XAML 设计实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57300733/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com