Unter WPF gibt es doch wirklich keinen Grund mehr, dafür ein TabControl zu missbrauchen. Ich weiß jetzt nicht, was ein "Quasi-Wizard" für Anforderungen besitzt
, aber statischer Content ist auch ohne 3rd-Party-Control kein großes Problem:
XML-Daten
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
| <Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Window.Resources> <x:ArrayExtension Type="UIElement" x:Key="Collection"> <TextBlock>Hello</TextBlock> <TextBox>World</TextBox> </x:ArrayExtension> </Window.Resources> </Window> |
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19:
| public partial class Window1 : Window { int index; UIElement[] collection; DispatcherTimer timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1) };
public Window1() { InitializeComponent(); collection = (UIElement[])Resources["Collection"]; timer.Tick += delegate { Content = collection[index++ % 2]; }; timer.Start(); } } |
Wenn der Content dynamisch ist, wird das Ganze dank Data Binding und Data Templates ja fast
noch einfacher
.