...
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.
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 |
---|
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 |
---|
NextAdditionally, adapt the contents of VolumeModelRibbon.xaml.cs as shown below (right click the class | View Code).
...