[英]Why does visual studio add “p:” to all my controls?
I've noticed that if I add a control by dragging it from the toolbox, the letter p, followed by a colon, is appended to the beginning of the control name, and also some of it's properties. 我注意到,如果我通过从工具箱中拖动控件来添加控件,则在控件名称及其某些属性的开头会附加字母p和冒号。 The "XAML Styler" extension also seems to do the same when you format. 格式化时,“ XAML Styler”扩展名似乎也做同样的事情。
I've noticed that everything (at least seems to) have the same exact behavior if you take off all the p's. 我注意到,如果取消所有p,则所有事物(至少似乎)具有相同的确切行为。
Is there any benefit to having, say 说有什么好处
<p:Rectangle
x:Name="leftPanel"
Grid.Row="1"
Fill="#FF2F3136" />
rather than 而不是
<Rectangle
x:Name="leftPanel"
Grid.Row="1"
Fill="#FF2F3136" />
It is just adding the reference to the namespace which would be defined at the top of the XAML document, like for example here: 它只是添加对将在XAML文档顶部定义的名称空间的引用 ,例如此处:
<Page x:Class="WPFApplication1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:custom="clr-namespace:SDKSample;assembly=SDKSampleLibrary">
...
<custom:ExampleClass/>
...
</Page>
You should probably find a reference to System.Windows.Shapes
defined in the namespaces at the top of your document 您可能应该找到对文档顶部名称空间中定义的System.Windows.Shapes
的引用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.