Updated RibbonBar

Update to RibbonBar - is now a separate Resource file. Simply merge into the resource dictionary and use the RibbonBarStyle on the TabControl you want to look like a Ribbon. The sample below can be copied direct into XAML viewer (e.g. Kaxaml). This is a XAML only version so doesn't contain any of the command binding stuff, curvy tab headers etc.

<Page
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <Page.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="http://www.spencen.com/downloads/RibbonBarResource.xaml"/>
      </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
  </Page.Resources>
  <StackPanel>
    <TabControl Style="{StaticResource RibbonBarStyle}">
      <TabItem Header="Tab 1">
        <ToolBarTray>
          <ToolBar>
            <Button Tag="http://www.spencen.com/downloads/Button1_48.png">Button 1</Button>
            <Button Tag="http://www.spencen.com/downloads/Button1_24.png">Button 2</Button>
            <Button Tag="http://www.spencen.com/downloads/Button1_24.png">Button 2.1</Button>
          </ToolBar>
        </ToolBarTray>
      </TabItem>
      <TabItem Header="Tab 2">
        <ToolBarTray>
          <ToolBar>
            <Button>Button 3</Button>
            <Button>Button 4</Button>
            <ComboBox Text="ComboBox 1" Width="80"/>
          </ToolBar>
        </ToolBarTray>
      </TabItem>
    </TabControl>
  </StackPanel>
</Page>

Grab the RibonBarResource.xaml from here.

 

What did you think of this article?




Trackbacks
  • Trackbacks are closed for this entry.
Comments

Leave a comment

Comments are closed.