views:

28

answers:

1

Say that I have the following piece of XAML:

<Window>
   <StackPanel Orientation="Horizontal">
      <Label>Phone:</Label>
      <TextBlock Text={Binding PhoneNumber}"/>
   </StackPanel>
</Window>

I would like to reuse this as the content of a ContextMenu. What is the best way to do that?

+1  A: 

You can make your StackPanel into a UserControl. This way you can reuse it.

Vlad
Thank you. I was looking for some other way (a resource?) as in my opinion a UserControl should me more generic, but it works very well!
Dabblernl