Can the Xaml Editor intellisense my plain old class properties?
Say I just have a plain old class with a public string property. What do I have to do to make intellisense work in the Xaml Editor?
public class MyType
{
public string MyProp { get; set; }
}
EDIT: Thanks for the answers. Xaml intellisense does work by default even without having to comment up all of your types and members, however the Xaml intellisense in Visual Studio 2010 is somewhat fragile. I eventually found the cause of my problem. Don't do this in a class in the namespace that you're expecting intellisense on:
public static class SomeHelper
{
static object GetSomething(object x)
{
return null;
}
static T Ge开发者_运维百科tSomething<T>(object x)
{
return default(T);
}
}
even though it compiles, the Xaml Editor must get confused between the two methods.
in the Project options, turn documentation generation on then document your classes using the XML documentation syntax. If you add /// to the line above a property/method/class it creates the comment template for you:
public class MyType
{
/// <summary>G
/// gets or sets the MyProp
/// </summary>
public string MyProp { get; set; }
}
You can look at any of the source files in the Microsoft Silverlight Analytics Framework to see examples of the documentation.
Yes , Create a XAML file. The root element of the XAML file would be
<MyType xmlns:"clr-namespace:NameSpace of MyType;assembly=Assembly of MyType">
<Mytype.Myprop="MyProperty"/>
</MyType>
after adding the class Build the solution then include that as the root element. Now you can have intellisense of your own type in the XAML file.
精彩评论