Question

I have the following XAML inside a <TabItem>:

<ScrollViewer ....>
    <Border ....>
        <DockPanel ...>
        ....
        </DockPanel>
    </Border>
</ScrollViewer>

This same XAML is going to repeated multiple times. I'm wondering if it would be easier to create some type of UserControl or custom control (not sure user control will work). Then, if I need to change a setting on one of those 3 it would cascade to all TabItems that contain the ScrollViewer/Border/DockPanel.

Was it helpful?

Solution

You can put the abouve XAML code into a UserControl for instance, but you need to know that each time you use the user control, a diferent instace will be created. So if you want update all instaces you need to make a binding to a common INotifyPropertyChanged class property.

Hope this could helps...

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