I have 4 buttons binding commands, I want to use tabcontrols accomplish these commands.
<Button Margin="5" Width="Auto" Height="26" Content="operating" Command="{Binding PCmd}" CommandParameter="{Binding ElementName=frame}"/>
<Button Margin="5" Width="Auto" Height="26" Content="settings" Command="{Binding SettingCmd}" CommandParameter="{Binding ElementName=frame}"/>
<Button Margin="5" Width="Auto" Height="26" Content="showing" Command="{Binding DiCmd}" CommandParameter="{Binding ElementName=frame}"/>
<Button Margin="5" Width="Auto" Height="26" Content="controls" Command="{Binding DeviceCmd}" CommandParameter="{Binding ElementName=frame}"/>
<Frame x:Name="frame" Source="PPage.xaml" NavigationUIVisibility="Hidden" />
settings commmand like this:
SettingCmd = new RelayCommand<System.Windows.Controls.Frame>
(
(f) =>
{
f.Navigate(new Uri(@"View\SettingPage.xaml", UriKind.Relative));
}
);
now I make these changes, how to add commands to them to accomplish the commands in buttons, and there are 4 xaml pages according to 4 buttons
<controls:MetroAnimatedSingleRowTabControl Grid.Row="1" x:Name="MainTabControl">
<TabItem Header="operating"></TabItem>
<TabItem Header="settings"></TabItem>
<TabItem Header="showing"></TabItem>
<TabItem Header="controls"></TabItem>
</controls:MetroAnimatedSingleRowTabControl>