Extended Library for WPF and Silverlight | ComponentOne
Reflector (Silverlight Only) / Task-Based Help / Adding a Control to the Reflector
In This Topic
    Adding a Control to the Reflector
    In This Topic

    The C1Reflector control can accept Silverlight UI controls. To illustrate this feature, this topic will have you add a standard Silverlight Button to the reflector. Once it is added to the control, you will see the control and its reflection in the C1Reflector control.

    At Design Time in Blend

    To add a control, complete the following steps:

    1. Under the Objects and Timeline tab, select All for a list of all available controls.
    2. In the list of controls, select the Button icon and then use a drag-and-drop operation to add it to the C1Reflector container.

    In XAML

    To add a control, place the following markup between the <c1ext:C1Reflector> and </c1ext:C1Reflector> tags:

    XAML
    Copy Code
    <Button Content="Button"></Button>
    

     

    In Code

    To add a control, complete the following steps:

    1. Add x:Name=C1Reflector1 to the <c1ext:C1Reflector> tag. This will give the control a unique identifier that you can use to call it in code.
    2. Switch to Code view and add the following beneath the InitializeComponent() method:
    Visual Basic
    Copy Code
    'Create a button object and name it
    Dim Button1 As New Button()
    Button1.Content = "Button"
    'Set the C1Reflector control's content to the button
    C1Reflector1.Content = Button1
    

     

    C#
    Copy Code
    //Create a button object and name it
    Button Button1 = new Button();
    Button1.Content = "Button";
    //Set the C1Reflector control's content to the button
    C1Reflector1.Content = Button1;
    
       

     

    1. Run the program.

     This Topic Illustrates the Following:

    The result of this topic will resemble the following image: