xamarin中的引用形式为XAML

xamarin中的引用形式为XAML,xaml,xamarin.forms,Xaml,Xamarin.forms,如何在XAML与代码隐藏中进行引用?在下面的snip中,mrkup:Class=“System.Web.UI.HtmlTextWriterTag”似乎可以工作 <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="ns.proj" mrkup:Cl

如何在XAML与代码隐藏中进行引用?在下面的snip中,mrkup:Class=“System.Web.UI.HtmlTextWriterTag”似乎可以工作

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         x:Class="ns.proj"
         mrkup:Class="System.Web.UI.HtmlTextWriterTag"
         >
        ...
这是一个很好的开始

 <mrkup:UI.HtmlTextWriterTag hr=""/>

失败,在xmlns clr命名空间System.Web中找不到mrkup:UI.HtmlTextWriterTag.hr;assembly=netstandard

是否有可能.UI不在.NET标准2.0中的System.Web中


更新到更新:

在.NET标准2.0的System.Web中,UI似乎是而不是。这来自C:\Program Files(x86)\Microsoft SDK\NuGetPackagesFallback\NETStandard.Library\2.0.1\build\netstandard2.0\ref中的System.Web.dll


实际上,在使用前必须声明
mrkup
前缀

就这样,

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="ns.proj"
             xmlns:mrkup="clr-namespace:System.Web.UI;assembly:dllName">
...
    <mrkup:HtmlTextWriterTag hr="Property Value"/>
...
</ContentPage>

...
...
我不确定名称空间的结束位置,因此在上面的代码片段中,我假设名称空间是
System.Web.UI
和类
HtmlTextWriterTag
,然后在其上有一个属性
hr
。如果引用的名称空间在实际项目之外,则必须注意
assembly
是声明的一部分,但在引用同一程序集的类时可以忽略它


您可以查看以获得更详细的信息。

要使用新名称空间,必须在使用xmlns:mrkup=“using:resulting in xmlns:mrkup=“clr namespace:System.Web;assembly=netstandard“现在,我们来看看如何深入研究UI和HtmlTextWriterTag。尽管System.Web.UI.HtmlTextWriterTag没有明确的答案。我觉得这就是添加对Xamarin.Forms-XAML的引用的基本问题的答案。这样标记。我可能错了,但我不相信您可以在
Xamarin.Forms
项目中引用
System.Web
您可以搜索(或打开,如果它不存在)以确定
UI是否不在.NET标准2.0中的System.Web中
I更新了帖子以显示System.Web的ILSpy。在.NET标准2.0中,您可以引用它,但页面上没有要“显示”的UI元素。
 <mrkup:UI.HtmlTextWriterTag hr=""/>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="ns.proj"
             xmlns:mrkup="clr-namespace:System.Web.UI;assembly:dllName">
...
    <mrkup:HtmlTextWriterTag hr="Property Value"/>
...
</ContentPage>