I have a WPF form that has a tab control on it. There are 5 tabs. The 'control content' of the tabs is to be identical... same buttons, lists, textboxes, etc. The content within those controls is to be different for each of the five tabs. It seems as if it would be quite painful to layout all 5 tabs in identical fashion. Even more painful would be changes/additons in the future. Is there some way to create the layout once and apply it to all 5 such that I could modify the 'template' and those changes would propagate through. Then at run time I could access a particular control with an index?
EDIT
Given that I have 10 of these user controls (SegmentControl) I have to adjust settings like so:
SegmentControl1.ComboBoxMode.ItemsSource = fc.CameraSettings.Modes;
SegmentControl1.ComboBoxMode.DisplayMemberPath = "Value";
SegmentControl1.ComboBoxMode.SelectedValuePath = "Key";
I would like to iterate through them using and index like so:
SegmentControl[index].ComboBoxMode.ItemsSource = fc.CameraSettings.Modes;
SegmentControl[index].ComboBoxMode.DisplayMemberPath = "Value";
SegmentControl[index].ComboBoxMode.SelectedValuePath = "Key";

2 answers
concerning the event problem, make a delegate in the user control that holds for example the index changed or the name of the item in the control inside the user control and make an event for it. so it will be an event that is called by an event handler. e.g.
this is just an example of how to make an event in a form of nested event so u can know that an inner control triggered an event.
answered 2 years ago by:
1556
add a user control that hold these same content "same buttons same textboxes same list etc.". Make a function in the control lets say LoadContents(string tabName){//TODO...} to change the content of these controls to whatever u like. so whenever the control is placed in the tab and the tab is shown call the LoadContents method in the user control sending the tabname as a parameter.
answered 2 years ago by:
1556
499
This solves the issue of making changes in the XAML and having it update everywhere the control is used. However, at runtime it's still not very efficient unless I am missing something. I have edited my original post with the issue...
499
Also... I am now trying to figure out how I respond to events of the user control. Not necessarily the control as a whole but for example one of the controls contained within the user control. Say I want to handle the Combobox SelectionChanged Event. How would I do this?