Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Create a new Ribbon control

Add Start by downloading documents-stack.png and adding the file to the project resources. This image must be build as a resource in order for WPF to use it, so select the image in the Resources folder and change the "Build action" property to Resource.
Now add a new folder to the plugin project named Ribbon. In this folder, create a new WPF user control named VolumeModelRibbon.xaml and adapt the contents (in the designer) as shown below:

...

Code Block
<UserControl x:Class="DeltaShell.Plugins.VolumeModel.Ribbon.VolumeModelRibbon"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:fluent="clr-namespace:Fluent;assembly=Fluent"
    mc:Ignorable="d" Height="145" Width="632">
    <!--Create a ribbon control-->
    <fluent:Ribbon Name="VolumeModelRibbonControl" x:FieldModifier="private">
        <!--Create a ribbon tab-->
        <fluent:RibbonTabItem Header="Volume model" fluent:KeyTip.Keys="E">
            <!--Create a ribbon group box-->
            <fluent:RibbonGroupBox Header="Input">
                <!--Create a ribbon button-->
                <fluent:Button x:Name="ButtonAddInputDataToVolumeModel"
                               Header="Add input data"
                               Icon="/DeltaShell.Plugins.VolumeModel;component\Resources\documents-stack.png"
                               ToolTip="Add input data to the selected volume model"
                               Click="ButtonAddInputDataToVolumeModel_OnClick"
                               Size="Middle"
                               SizeDefinition="Middle,Small,Small"/>
            </fluent:RibbonGroupBox>
        </fluent:RibbonTabItem>
    </fluent:Ribbon>
</UserControl>

...