Question

Is it possible to customize default user control markup in xaml ?

Let's say i have a user control named MyUserControl.

What I would like to know - is it possible, when I type

  <controls:MyUserControl -and then type- > 

instead of just ending up with

  <controls:MyUserControl ></controls:MyUserControl>

to have

  <controls:MyUserControl DependencyProperty="1" DependencyProperty="Person" ... ></controls:MyUserControl>'

Basically I want to create a custom template that would be used when auto-completing user control in xaml editor.

Purpose is to show the user available properties right away ( user that wants to use some control that he did not use before can see how to change important properties without browsing all possible properties on user control )

No correct solution

OTHER TIPS

As far as I am aware, there is no simple way to do that, but I'd say that it was unadvisable to try to do that anyway. You said that you want to show the user available properties right away, but that is what Microsoft's Intellisense in Visual Studio is for. Once you have declared your DependencyPropertys, they'll automatically appear in a popup when a user is using your class.

As the .NET controls do not do what you suggest, then yours shouldn't really do that either. You're more likely to confuse developers with this unusual behaviour and they might even leave these added and quite possibly unwanted properties because they don't know any better. Your best bet to help users of your code is to implement it in as standard a way as possible, so that everything will work as expected.

You know, the most annoying bugs are caused from problems with code that was meant to help us.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top