The C1Expander control's header element is able to accept a Silverlight control. In this topic, you will add a Button control to the header in XAML and in code.
In XAML
To add a Button control to the header in XAML, place the following XAML markup between the <c1ext:C1Expander> and </c1ext:C1Expander> tags:
XAML |
Copy Code
|
---|---|
<c1ext:C1Expander.Header> <Button Content="Button" Height="Auto" Width="50"/> </c1ext:C1Expander.Header> |
In Code
To add a Button control to the header in code, complete the following steps:
Visual Basic Copy Code 'Create the Button control Dim NewButton As New Button() NewButton.Content = "Button" 'Set the Button Control's Width and Height properties NewButton.Width = 50 NewButton.Height = Double.NaN 'Add the Button to the header C1Expander1.Header = (NewButton)
C# Copy Code //Create the Button control Button NewButton = new Button(); NewButton.Content = "Button"; //Set the Button Control's Width and Height properties NewButton.Width = 50; NewButton.Height = Double.NaN; //Add the Button to the header C1Expander1.Header = (NewButton);
This Topic Illustrates the Following:
As a result of this topic, a Button control will appear in the header. The final result will resemble the following image: