Mari kita lanjutkan membuat aplikasi ribbon dengan powerbuilder 12.5 .NET yang memakai WPF Window,
- Menambahkan Folder Image dengan cara klik kanan pada "Target", pilih "New Folder" dan kita beri nama new folder tersebut "Image", selanjutnya kita klik kanan pada folder image untuk menambahkan image yang kita inginkan dengan memilih "Add Existing Item"
sebagai contoh ambil image yang ada di oddysey
selanjutnya kita lihat hasilnya sebagai berikut :
- Selanjutnya Buka w_ribbonpad.xaml sesuaikan dengan script berikut
<pbwpf:Window x:Class="RibbonDemo.w_ribbonpad" x:ClassModifier="internal"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:pbwpf="clr-namespace:Sybase.PowerBuilder.WPF.Controls;assembly=Sybase.PowerBuilder.WPF.Controls"
PBTitle="RibbonPad" PBHeight="2000" PBWidth="2500" MinBox="True" MaxBox="True" TitleBar="True"
xmlns:odc="clr-namespace:Odyssey.Controls;assembly=Odyssey" PBWindowState="Maximized"
ControlMenu="True" pbwpf:Window.Skin="ExpressionDark" Uid="6" Height="500" Width="547">
<DockPanel RenderOptions.BitmapScalingMode="HighQuality">
<odc:RibbonBar x:Name="ribbonBar" Title="RibbonPad" DockPanel.Dock="Top" Foreground="White">
<odc:RibbonBar.QAToolBar>
<odc:RibbonQAToolBar>
<odc:RibbonButton SmallImage="image/save16.png" Name="office_blue" />
<odc:RibbonButton SmallImage="image/undo16.png" Name="win7" />
<odc:RibbonButton SmallImage="image/delete16.png" Name="office_silver" />
<odc:RibbonButton SmallImage="image/folder16.png" Name="office_black" />
</odc:RibbonQAToolBar>
</odc:RibbonBar.QAToolBar>
<odc:RibbonBar.ApplicationMenu>
<odc:RibbonApplicationMenu MenuButtonImage="image/favorites16.png">
<odc:RibbonApplicationMenu.RecentItemsList>
<TextBlock Text="This is a Placeholder for recent documents" Margin="3"
HorizontalAlignment="Center" VerticalAlignment="Top" MinHeight="150"
TextWrapping="Wrap" MinWidth="100" />
</odc:RibbonApplicationMenu.RecentItemsList>
<odc:RibbonApplicationMenu.Footer>
<StackPanel HorizontalAlignment="Stretch" Margin="0,4,0,0"></StackPanel>
</odc:RibbonApplicationMenu.Footer>
</odc:RibbonApplicationMenu>
</odc:RibbonBar.ApplicationMenu>
<odc:RibbonTabItem Title="File">
<odc:RibbonGroup Title="Skin" Image="image/home16.png" IsDialogLauncherVisible="True">
<odc:RibbonToggleButton Content="Search" odc:RibbonBar.MinSize="Large"
LargeImage="image/search32.png"/>
<odc:RibbonSeparator />
<odc:RibbonButton Content="Windows 7" odc:RibbonBar.MinSize="Large"
SmallImage="image/save16.png" LargeImage="image/Save32.png" />
<odc:RibbonButton Content="Office Blue" odc:RibbonBar.MinSize="Medium"
SmallImage="image/home16.png" LargeImage="image/home32.png" />
<odc:RibbonButton Content="Office Silver" odc:RibbonBar.MinSize="Medium"
SmallImage="image/paste16.png" LargeImage="image/paste32.png" />
<odc:RibbonButton Content="Office Black" odc:RibbonBar.MinSize="Medium"
SmallImage="image/folder16.png" LargeImage="image/folder16.png" />
</odc:RibbonGroup>
</odc:RibbonTabItem>
</odc:RibbonBar>
</DockPanel>
</pbwpf:Window>
- Double klik pada target dan ketikan script "open(w_ribbonpad)"
- Tambahkan script ini Odyssey.Controls.Classes.SkinManager.SkinId = Odyssey.Controls.Classes.SkinId.OfficeBlack! pada event open di w_ribbonpad
Selamat Mencoba....