CodeProject文章中的XAML代码 [英] XAML code in CodeProject Article

查看:108
本文介绍了CodeProject文章中的XAML代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请有人告诉我如何在CodeProject上的文章中粘贴xaml代码.

< pre lang ="......

Please can someone tell me how to paste xaml code in articles on CodeProject.

<pre lang="......

推荐答案

由于XAML是XML,因此您需要使用lang =" XML.唯一的问题是如何显示HTML格式的XML.请使用改进解决方案"(请不要提交!)或浏览器的查看页面源代码"查看此解决方案.

如果您编写代码:

As XAML is XML, you need to use lang="XML". The only problem is how to show XML in HTML. Look at this solution using "Improve solution" (please don''t commit!) or your browser''s "View Page Source". You will get the idea.

If you write the code:

<pre lang="XML">
&lt;Window x:Class=&quot;WpfApplication1.MainWindow&quot;
        xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
        xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
        Title=&quot;MainWindow&quot; Height=&quot;350&quot; Width=&quot;525&quot;&gt;
&lt;!-- ... --&gt;
&lt;/Window&gt;
</pre>



它将呈现为:



It will render as:

<Window x:Class="WpfApplication1.MainWindow"

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        Title="MainWindow" Height="350" Width="525">
<!-- ... -->
</Window>



-SA



—SA


粘贴代码,然后选择代码块(如果使用的是HTML5兼容浏览器).
示例如下-
Paste you code and then choose code block (if you are using an HTML5 compliant browser).
Example as below -
<textblock>Xaml here</textblock>


< pre lang ="XML">
在此处添加您的XAML
</pre>
<pre lang="XML">
add your XAML here
</pre>


这篇关于CodeProject文章中的XAML代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆