O'Reilly logo

Mastering LOB Development for Silverlight 5: A Case Study in Action by Rocío Serrano, Braulio Díez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Interacting with Code-Behind

In the following example, we will allow the user to change the message Hello World! to one of their choice. Starting from the previous example, we will follow the given steps:

  1. Open the mainpage.xaml file.
  2. Replace the XAML code inserted in the previous example by the one highlighted as follows (we have added an additional textbox, a button, and identifiers for the controls).
    <Grid x:Name="LayoutRoot" Background="White">
    
    <StackPanel Orientation="Vertical">
    <TextBlock x:Name="tbLabel"
    Text="Hello World!"
    FontSize="20"/>
    <StackPanel Orientation="Horizontal">
    <TextBlock
    Text="New Text:"
    FontSize="16"/>
    <TextBox
    x:Name="txInput"
    Width="120"/>
    <Button Content="Change"/>
    </StackPanel>
    </StackPanel>
    
    </Grid>
    
  3. When we build and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required