ou can add any sort of arbitrary content to a C1Book control. This includes text, images, layout panels, and other standard and 3rd-party controls. In this example, you'll add a TextBlock control to a C1Book control, but you can customize the steps to add other types of content instead.
At Design Time
To add a TextBlock control to the book, complete the following steps:
In XAML
For example, to add a TextBlock control to the book add <TextBlock Text="Hello World!"/> within the <c1:C1Book> tag so that it appears similar to the following:
XAML |
Copy Code
|
---|---|
<c1:C1Book x:Name="C1Book1" Height="300" Width="450"> <TextBlock Text="Hello World!"/> </c1:C1Book> |
In Code
For example, to add a TextBlock control to the book, add code to the page's constructor so it appears like the following:
Visual Basic |
Copy Code
|
---|---|
Public Sub New() InitializeComponent() Dim txt1 as New TextBlock txt1.Text = "Hello World!" C1Book1.Items.Add(txt1) End Sub |
C# |
Copy Code
|
---|---|
public MainPage() { InitializeComponent(); TextBlock txt1 = new TextBlock(); txt1.Text = "Hello World!"; c1Book1.Items.Add(txt1); } |
What You've Accomplished
You've added a control to the C1Book control. Run the application and observe that the TextBlock control has been added to the C1Book control. You can similarly add other content and controls.