Versions Compared

Key

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

...

Start by downloading documents-stack.png and adding the file to the project resources. This image must be build built as a resource in order for WPF to use it, so select the image in the Resources folder shown in the Solution Explorer panel of Visual Studio and change the "Build action" property to Resource.

Image Added

 

Now, add a new folder named Ribbon to the plugin project named Ribbon. In Inside this folder, create a new WPF user control named VolumeModelRibbon.xaml and adapt the contents (in the designer) as shown below:

Note

In order to successfully build the code below, references need to be added to:

  • Fluent

These Dlls can all be found in the packages folder of the solution (D:\VolumeModel\packages\DeltaShell.Framework.1.1.1.34867\lib\net40\DeltaShell).

After adding the references be sure to set the copylocal property of the references to false to prevent duplication of dlls in the bin folder.

 

Code Block
<UserControl x:Class
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>
Note

In order to successfully build the code below, references need to be added to:

  • Fluent

This dll can be found in the packages folder of the solution (D:\VolumeModel\packages\DeltaShell.Framework.1.1.1.34867\lib\net40\DeltaShell).


After adding the references be sure to set the Copy Local property of the references to False to prevent duplication of dll's in the bin folder.

 

NextAdditionally, adapt the contents of VolumeModelRibbon.xaml.cs as shown below (right click the class | View Code).

...