Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > BOOK: Silverlight 1.0 ISBN 978-0-470-22840-1
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Silverlight 1.0 ISBN 978-0-470-22840-1
This is the forum to discuss the Wrox book Silverlight 1.0 by Devin Rader, Jason Beres, J. Ambrose Little, Grant Hinkson; ISBN: 9780470228401
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Silverlight 1.0 ISBN 978-0-470-22840-1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 25th, 2007, 02:47 PM
Authorized User
Join Date: Nov 2007
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Accessing Storyboards Programmatically

I ran the example described in Listing 4-31 and 4-32.

"Begin" starts the rectangle moving.

"Stop" sometimes, but not always, stops the rectangle once its moving. It doesn't stop it in place though. It always places it in a certain position on the canvas.

"Pause" and "Resume" don't do anything at all.

This doesn't seem work as it should. Can anyone explain this behavior? Does this actually work? What would cause it not to work?

Reply With Quote
  #2 (permalink)  
Old November 26th, 2007, 03:10 PM
Authorized User
Join Date: Nov 2007
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts

I think I found the problem. In the XAML, the rectangles are created first. Then the textblocks are created in the very same positions. The textblocks cover up the rectangles, so you are clicking on the textblocks instead of the rectangles. The events are not fired because the events are defined in the XAML of the rectangles. I commented out the textblocks to test this out (see below) and the events fired as they should.

<Rectangle x:Name="pause"
    MouseLeftButtonUp="pause_onMouseLeftButtonUp" Fill="Blue"
        Height="23" Width="75" Canvas.Top="10" Canvas.Left="95" />
    <Rectangle x:Name="resume"
    MouseLeftButtonUp="resume_onMouseLeftButtonUp" Fill="Blue"
        Height="23" Width="75" Canvas.Top="10" Canvas.Left="265" />
    <Rectangle x:Name="stop"
    MouseLeftButtonUp="stop_onMouseLeftButtonUp" Fill="Blue"
        Height="23" Width="75" Canvas.Top="10" Canvas.Left="180" />
    <Rectangle x:Name="begin"
    MouseLeftButtonUp="begin_onMouseLeftButtonUp" Fill="Blue"
        Height="23" Width="75" Canvas.Top="10" Canvas.Left="10" />

    <TextBlock Text="Begin" Height="23" Width="75"
        Canvas.Top="10" Canvas.Left="10" />
    <TextBlock Text="Pause" Height="23" Width="75"
        Canvas.Top="10" Canvas.Left="95" />
    <TextBlock Text="Stop" Height="23" Width="75"
        Canvas.Top="10" Canvas.Left="180" />
    <TextBlock Text="Resume" Height="23" Width="75"
        Canvas.Top="10" Canvas.Left="265" />
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add a datagridcombobox programmatically ? maximus101 VB Databases Basics 1 October 23rd, 2006 03:08 PM
Programmatically rendering to PDF Jonskin BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 4 September 15th, 2006 04:02 AM
How do i delete relationships programmatically Ssemat VB.NET 2002/2003 Basics 0 December 23rd, 2005 09:09 AM
Report - programmatically creating penta Access 12 May 19th, 2005 04:53 PM
Creating Tables Programmatically stu9820 ASP.NET 1.0 and 1.1 Basics 10 October 22nd, 2003 04:25 PM

All times are GMT -4. The time now is 05:51 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.