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 503399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:23:24+00:00 2026-05-13T06:23:24+00:00

Silverligh 4, VS 2010. Making a Custom Control. (Non just UserControl, but public class

  • 0

Silverligh 4, VS 2010.

Making a Custom Control. (Non just UserControl, but public class HandPart : Control, and a template in \themes)

Then I creating a new DependencyProperty with a helper snippet:

#region SomeDouble (DependencyProperty)

/// <summary>
/// A description of the property.
/// </summary>
public Double SomeDouble
{
    get { return (Double)GetValue(SomeDoubleProperty); }
    set { SetValue(SomeDoubleProperty, value); }
}
public static readonly DependencyProperty SomeDoubleProperty =
    DependencyProperty.Register("SomeDouble", typeof(Double), typeof(HandPart),
      new PropertyMetadata(0));

#endregion

As a result solution is compiling with out any errors and messages but it not starting up.
When I creating DependencyProperty with, fore example, Int type insted Double or Single, it’s working OK.

What is the problem, (feature?) with float? Why I can’t create DP with a floats types?

  • 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-13T06:23:25+00:00Added an answer on May 13, 2026 at 6:23 am

    The 0 argument that you’re passing to the PropertyMetadata constructor will be interpreted as an int rather than a double. Try passing 0.0 instead:

    public static readonly DependencyProperty SomeDoubleProperty =
        DependencyProperty.Register("SomeDouble", typeof(Double),
            typeof(HandPart), new PropertyMetadata(0.0));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just successfully installed Silverlight 4 tools for visual studio 2010. But I can't
I am building a custom control using studio 2010 and silverlight 4. I am
Silverlight filter/class for cloud generation? Some HLSL or just C# class for generating clouds?
I'm watching at this page: http://leeontech.wordpress.com/2010/02/01/summary-row-in-datagrid/ But they're using silverlight. I'm trying to create
Does Visual Studio 2010's Silverlight support ArrayList? If yes then how to use it,
Visual Studio 2010 RC -> Silverlight Application We have a library of images that
In Visual Studio 2010 Beta 2 I created a new navigation Silverlight application. Without
Is Silverlight for Mobile now available as of today, April 21, 2010? Is it
How do I share files between WPF and Silverlight projects in Visual Studio 2010?
in Silverligh + RIA app, I am retriving date from mssql08 server, when it

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.