私はWPFが初めてで、リボンコントロールで遊んでいました。以下のコードに示すように、3 つの異なるリボン タブがあります。同じ料金所のボタンを使用しています。以下に示すように書いた方法は、メモリに最適なアプローチのようには見えません。すべてのリボン タブで繰り返しなしで同じツールバーを使用できるように、コードを変更するのを手伝ってくれる人はいますか?
<ribbon:RibbonTab x:Name="HomeTab"
Header="Home">
<ribbon:RibbonGroup x:Name="Group1"
Header="">
<ribbon:RibbonButton x:Name="Update1"
LargeImageSource="/T-Spy;component/Resources/favicon.ico"
Label="Update" />
<ribbon:RibbonButton x:Name="Register1"
LargeImageSource="/T-Spy;component/Resources/favicon.ico"
Label="Register" />
<ribbon:RibbonButton x:Name="Uninstall1"
LargeImageSource="/T-Spy;component/Resources/favicon.ico"
Label="Uninstall" />
<ribbon:RibbonButton x:Name="Invisible1"
LargeImageSource="/T-Spy;component/Resources/favicon.ico"
Label="Go invisible" Click="Invisible_Click"/>
<ribbon:RibbonButton x:Name="Help1"
LargeImageSource="/T-Spy;component/Resources/favicon.ico"
Label="Help" />
<ribbon:RibbonButton x:Name="Quit1"
LargeImageSource="/T-Spy;component/Resources/favicon.ico"
Label="Quit" Click="Quit_Click"/>
</ribbon:RibbonGroup>
</ribbon:RibbonTab>
<ribbon:RibbonTab x:Name="LogTab"
Header="Log History">
<ribbon:RibbonGroup x:Name="Group11"
Header="">
<ribbon:RibbonButton x:Name="Update2"
LargeImageSource="/T-Spy;component/Resources/favicon.ico"
Label="Update" />
<ribbon:RibbonButton x:Name="Regiter2"
LargeImageSource="/T-Spy;component/Resources/favicon.ico"
Label="Register" />
<ribbon:RibbonButton x:Name="Uninstall2"
LargeImageSource="/T-Spy;component/Resources/favicon.ico"
Label="Uninstall" />
<ribbon:RibbonButton x:Name="Invisible2"
LargeImageSource="/T-Spy;component/Resources/favicon.ico"
Label="Go invisible" Click="Invisible_Click"/>
<ribbon:RibbonButton x:Name="Help2"
LargeImageSource="/T-Spy;component/Resources/favicon.ico"
Label="Help" />
<ribbon:RibbonButton x:Name="Quit2"
LargeImageSource="/T-Spy;component/Resources/favicon.ico"
Label="Quit" Click="Quit_Click" />
</ribbon:RibbonGroup>
</ribbon:RibbonTab>
<ribbon:RibbonTab x:Name="SettingsTab"
Header="Settings">
<ribbon:RibbonGroup x:Name="Group21"
Header="">
<ribbon:RibbonButton x:Name="Update3"
LargeImageSource="/T-Spy;component/Resources/favicon.ico"
Label="Update" />
<ribbon:RibbonButton x:Name="Register3"
LargeImageSource="/T-Spy;component/Resources/favicon.ico"
Label="Register" />
<ribbon:RibbonButton x:Name="Uninstall3"
LargeImageSource="/T-Spy;component/Resources/favicon.ico"
Label="Uninstall" />
<ribbon:RibbonButton x:Name="Invisible3"
LargeImageSource="/T-Spy;component/Resources/favicon.ico"
Label="Go invisible" Click="Invisible_Click" />
<ribbon:RibbonButton x:Name="Help3"
LargeImageSource="/T-Spy;component/Resources/favicon.ico"
Label="Help" />
<ribbon:RibbonButton x:Name="Quit3"
LargeImageSource="/T-Spy;component/Resources/favicon.ico"
Label="Quit" Click="Quit_Click"/>
</ribbon:RibbonGroup>
</ribbon:RibbonTab>