Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6475289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:41:12+00:00 2026-05-25T06:41:12+00:00

I just thought I already know how WPF and XAML Syntax works…. wrooong. I

  • 0

I just thought I already know how WPF and XAML Syntax works….
wrooong.

I got the message:

'WithEvents' variables can only be typed as classes, interfaces or type parameters with class constraints.

Please, do you know why this syntax is wrong?

I need to use the single value as double. It works later with an storyboard in codebehind.

Regards
Error Screenshot

I just want to animate the Red rectangle with a storyboard in location and size. Perhaps XAML is the right solution anyway?
Red rectangle

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:41:13+00:00Added an answer on May 25, 2026 at 6:41 am

    To animate thickness, use a Storyboard like this (from msdn example):

    <BeginStoryboard>
        <Storyboard>    
          <!-- BorderThickness animates from left=1, right=1, top=1, and bottom=1 to
          left=28, right=28, top=14, and bottom=14 over one second. -->
          <ThicknessAnimation
            Storyboard.TargetProperty="BorderThickness"
            Duration="0:0:1.5" FillBehavior="HoldEnd" From="1,1,1,1" To="28,14,28,14" />
        </Storyboard>
      </BeginStoryboard>
    

    Actually, to animate any property that takes values as “w,x,y,z” you use a ThicknessAnimation

    It seems to me that what you want to do is move the red rectangle to the right.

    In that case, put the whole thing in a Canvas and use a DoubleAnimation on the red rectangle’s position.

    Either way, the error you’re getting does not come from the small piece of code you provided, if you want to adress that, please provide use with more code.

    Edit: since ThicknessAnimation seems to be not available on WP7, try this instead:

    <BeginStoryboard>
        <Storyboard>    
          <DoubleAnimation
            Storyboard.TargetProperty="BorderThickness.Top"
            Duration="0:0:1.5" To="15" />
          <DoubleAnimation
            Storyboard.TargetProperty="BorderThickness.Left"
            Duration="0:0:1.5" To="25" />
        </Storyboard>
      </BeginStoryboard>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just amazed to know that I can't convert signed to unsigned int by
I am pretty sure I know the answer already but thought I'd ask anyways.
I thought I already know when a variable has a value. But I was
OK, I am sure some of you already know whats happening just by my
I already know that a JLabel can use an ImageIcon in the declaration of
I just thought about the non-blocking infrastructure of tornado and event-driven programming. Actually I'm
I probably just haven't thought this through, or perhaps I'm simply unaware of an
I was just putting some thought into different languages (as I'm reviewing for final
I may not understand what the return statement does(I thought it just returned a
I thought to be clever and just put an transparent UIButton over an UIImageView

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.