gpt4 book ai didi

c# - 在 XAML + windows 8 中呈现 Html

转载 作者:行者123 更新时间:2023-12-02 05:28:31 25 4
gpt4 key购买 nike

我的模型中有一个包含 HTML ex 的属性:

public class watch
{
public string description=<div>hello<br/> world</div>
}

我需要在 xaml 代码的 View 中将此描述与合成器绑定(bind)。我应该使用哪个合成器(RichTextblock 或...)来呈现此 html?如果我使用 <textblock text={binding="descrption"}/> html 标签仍然可见,我需要返回 ligne 并且不显示 html 标签

有什么想法吗??

最好的问候

最佳答案

The WebView control gives us a way to host HTML data within our app. But if we look at its Source property, we see that it takes the Uri of the web page to display. Our HTML data is just a string of HTML. It doesn't have a Uri that we can bind to the Source property. Luckily, there is a NavigateToString method that we can pass our string of HTML to.

也一样:

ContentView.NavigateToString(w.description);

http://msdn.microsoft.com/en-us/library/windows/apps/br211380.aspx

关于c# - 在 XAML + windows 8 中呈现 Html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12730813/

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