Version

SetSortOrder Method

Sets the value of the 'SortOrder' attached property
Syntax
'Declaration
 
Public Shared Sub SetSortOrder( _
   ByVal d As DependencyObject, _
   ByVal value As Integer _
) 
public static void SetSortOrder( 
   DependencyObject d,
   int value
)

Parameters

d
value
Example
ToolHorizontalWrapPanel SetSortOrder, GetSortOrder methods

Dim toolHWrapPanel As New ToolHorizontalWrapPanel() 
toolHWrapPanel.MinRows = 1 
toolHWrapPanel.MaxRows = 2 

Dim button1 As New ButtonTool() 
button1.Caption = "Tool Button 1 ... " 

Dim button2 As New ButtonTool() 
button2.Caption = "Tool Button 2 ... " 

Dim button3 As New ButtonTool() 
button3.Caption = "Tool Button 3 ... " 

Dim button4 As New ButtonTool() 
button4.Caption = "Tool Button 4 ... " 

Dim button5 As New ButtonTool() 
button5.Caption = "Tool Button 5 ... " 

toolHWrapPanel.Children.Add(button1) 
toolHWrapPanel.Children.Add(button2) 
toolHWrapPanel.Children.Add(button3) 
toolHWrapPanel.Children.Add(button4) 
toolHWrapPanel.Children.Add(button5) 

ToolHorizontalWrapPanel.SetSortOrder(button1, 10) 
ToolHorizontalWrapPanel.SetSortOrder(button2, 20) 
ToolHorizontalWrapPanel.SetSortOrder(button3, 30) 
Dim sortOrder As Integer = ToolHorizontalWrapPanel.GetSortOrder(button3) 
ToolHorizontalWrapPanel.SetSortOrder(button4, sortOrder - 1) 
ToolHorizontalWrapPanel.SetSortOrder(button5, sortOrder + 1)
ToolHorizontalWrapPanel toolHWrapPanel = new ToolHorizontalWrapPanel();
toolHWrapPanel.MinRows = 1;
toolHWrapPanel.MaxRows = 2;

ButtonTool button1 = new ButtonTool();
button1.Caption = "Tool Button 1 ... ";

ButtonTool button2 = new ButtonTool();
button2.Caption = "Tool Button 2 ... ";

ButtonTool button3 = new ButtonTool();
button3.Caption = "Tool Button 3 ... ";

ButtonTool button4 = new ButtonTool();
button4.Caption = "Tool Button 4 ... ";

ButtonTool button5 = new ButtonTool();
button5.Caption = "Tool Button 5 ... ";

toolHWrapPanel.Children.Add(button1);
toolHWrapPanel.Children.Add(button2);
toolHWrapPanel.Children.Add(button3);
toolHWrapPanel.Children.Add(button4);
toolHWrapPanel.Children.Add(button5);

ToolHorizontalWrapPanel.SetSortOrder(button1, 10);
ToolHorizontalWrapPanel.SetSortOrder(button2, 20);
ToolHorizontalWrapPanel.SetSortOrder(button3, 30);
int sortOrder = ToolHorizontalWrapPanel.GetSortOrder(button3);
ToolHorizontalWrapPanel.SetSortOrder(button4, sortOrder-1);
ToolHorizontalWrapPanel.SetSortOrder(button5, sortOrder + 1);
<igRibbon:ToolHorizontalWrapPanel MaxRows="3" MinRows="1">
    
<igRibbon:ButtonTool igRibbon:ToolHorizontalWrapPanel.SortOrder="1" Id="Button1" Caption="Tool Button1 ... " />
    
<igRibbon:ButtonTool igRibbon:ToolHorizontalWrapPanel.SortOrder="2" Id="Button2" Caption="Tool Button2 ... " />
    
<igRibbon:ButtonTool igRibbon:ToolHorizontalWrapPanel.SortOrder="13" Id="Button3" Caption="Tool Button3 ... " />
    
<igRibbon:ButtonTool igRibbon:ToolHorizontalWrapPanel.SortOrder="14" Id="Button4" Caption="Tool Button4 ... " />
    
<igRibbon:ButtonTool igRibbon:ToolHorizontalWrapPanel.SortOrder="5" Id="Button5" Caption="Tool Button5 ... " />
</igRibbon:ToolHorizontalWrapPanel>
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also