C1Toolbar Task-Based Help > Adding Logic Behind the ToolbarButton Click Event |
This topic shows how to add logic behind the C1ToolbarButton Click event for C1ToolbarButtons through XAML representation and then adding the code for the method in the Code Editor.
XAML |
Copy Code
|
---|---|
<c1:C1Toolbar Grid.Row="1" Height="100" Name="c1Toolbar1"> <c1:C1ToolbarButton LabelTitle="Search" </c1:C1Toolbar> |
XAML |
Copy Code
|
---|---|
<c1:C1Toolbar Grid.Row="1" Height="100" Name="c1Toolbar1"> <c1:C1ToolbarButton LabelTitle="Search" Click="New_Click" Name="Search"/> </c1:C1Toolbar> |
C# |
Copy Code
|
---|---|
private void New_Click(object sender, RoutedEventArgs e) { MessageBox.Show("Event handler was created by clicking the " + Search); } |
Run the application and observe:
The name of the toolbar button appears in the message box: