O'Reilly logo

Microsoft Silverlight 4 Business Application Development Beginner's Guide by Frank LaVigne, Cameron Albert

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

Time for action - adding an erase feature

Let's improve our sketching application in Silverlight by adding an erase feature.

  1. Open the SilverInk application in Visual Studio.
  2. We're going to add three new buttons: one to switch to eraser mode, the second to delete the last stroke added, and the third one to clear the entire inkPresenter.
  3. Add the following XAML to the StackPanel where all the other buttons reside:
    <Button x:Name="btnErase"
    Content="Eraser"
    Click="btnErase_Click" />
    <Button x:Name="btnDeleteLastStroke"
    Content="Delete Last Stroke"
    Click="btnDeleteLastStroke_Click" />
    <Button x:Name="btnClear"
    Content="Clear All"
    Click="btnClear_Click" />
    
  4. Right-click on each of the Button nodes and select Navigate to Event Handler to have Visual Studio ...

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