Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Implicit Type Casting

Implicit Type Casting

Scheduled Pinned Locked Moved C#
wpfquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Adriaan Davel
    wrote on last edited by
    #1

    When creating a Silverlight dependency property of type decimal (on my control) I got the following errors when setting a value in XAML: Failed to create a 'System.Decimal' from the text '200.0'. Failed to create a 'System.Decimal' from the text '200'. SERIOUSLY? Is it THAT hard?

    ____________________________________________________________ Be brave little warrior, be VERY brave

    S P 2 Replies Last reply
    0
    • A Adriaan Davel

      When creating a Silverlight dependency property of type decimal (on my control) I got the following errors when setting a value in XAML: Failed to create a 'System.Decimal' from the text '200.0'. Failed to create a 'System.Decimal' from the text '200'. SERIOUSLY? Is it THAT hard?

      ____________________________________________________________ Be brave little warrior, be VERY brave

      S Offline
      S Offline
      SledgeHammer01
      wrote on last edited by
      #2

      No. It sounds like your DP and/or XAML is wrong. You might want to post them :).

      A 1 Reply Last reply
      0
      • S SledgeHammer01

        No. It sounds like your DP and/or XAML is wrong. You might want to post them :).

        A Offline
        A Offline
        Adriaan Davel
        wrote on last edited by
        #3

        Well here's the answer, kinda silly that you need a special Type Converter for this... http://forums.silverlight.net/forums/p/65691/161424.aspx[^]

        ____________________________________________________________ Be brave little warrior, be VERY brave

        1 Reply Last reply
        0
        • A Adriaan Davel

          When creating a Silverlight dependency property of type decimal (on my control) I got the following errors when setting a value in XAML: Failed to create a 'System.Decimal' from the text '200.0'. Failed to create a 'System.Decimal' from the text '200'. SERIOUSLY? Is it THAT hard?

          ____________________________________________________________ Be brave little warrior, be VERY brave

          P Online
          P Online
          PIEBALDconsult
          wrote on last edited by
          #4

          C# expects decimal literals to have an M at the end -- 200.0M, will that work?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups