You can add any sort of arbitrary content to a C1Cube 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 C1Cube control, but you can customize the steps to add other types of content instead.
At Design Time in Blend
To add a TextBlock control to the cube in Blend, complete the following steps:
1. Click the C1Cube control once to select it.
2. Navigate to the Toolbox, and double-click the TextBlock item to add the control to the C1Cube control.
3. In the XAML view you can specify the face of the cube the TextBlock should appear in by adding c1ext:C1Cube.Face="Front" to the <TextBlock/> tag so that it appears like the following:
<TextBlock c1ext:C1Cube.Face="Front"/>
4. If you choose, can customize the C1Cube and TextBlock controls by selecting each control and setting properties in the Properties window. For example, set the TextBlock's Text property to "Hello World!".
In XAML
For example, to add a TextBlock control to the cube add <TextBlock c1ext:C1Cube.Face="Front" Text="Hello World!"/> within the <c1ext:C1Cube> tag so that it appears similar to the following:
<c1ext:C1Cube x:Name="c1cube1" Height="300" Width="300">
<TextBlock c1ext:C1Cube.Face="Front" Text="Hello World!"/>
</c1ext:C1Cube>
In Code
For example, to add a TextBlock control to the cube, add code to the page's constructor so it appears like the following:
Public Sub New()
InitializeComponent()
Dim txt1 as New TextBlock
txt1.Text = "Hello World!"
C1Cube1.Items.Add(txt1)
C1Cube.SetFace(txt1, CubeFace.Top)
End Sub
•C#
public MainPage()
{
InitializeComponent();
TextBlock txt1 = new TextBlock();
txt1.Text = "Hello World!";
c1Cube1.Items.Add(txt1);
C1Cube.SetFace(txt1, CubeFace.Top);
}
What You've Accomplished
You've added a control to the C1Cube control. Run the application and observe that the TextBlock control has been added to the front face of the C1Cube control. You can similarly add other content and controls.