0

I have this XAML code block:

    <StackPanel Orientation="Horizontal">
        <TextBlock Text="Hello " />
        <TextBlock Text="World" />
    </StackPanel>

I would like to define this block (for example in /Common/CustomStyles.xaml) to include it on different XAML pages. How does it work?

I do not need a DataTemplate or something similar because the text is static.

1 Answer 1

1

You could put it in a user control and re-use it that way. If it's just the text you are interested in then you could use a resource file - this would update the textbox on any screen as long as it had the right uid.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.