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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:02:51+00:00 2026-05-16T14:02:51+00:00

My goal is to be able to write this in XAML: <Grid> <Rectangle Fill=AliceBlue

  • 0

My goal is to be able to write this in XAML:

<Grid>
    <Rectangle Fill="AliceBlue"
            myCore:MyTimePanel.BeginningDate="03/03/2010"
            />
</Grid>

Problem :
Silverlight XAML can’t parse a DateTime from a string. So at runtime I have the XamlParseException “can’t create a DateTime from that string”.

When I use a simple DependencyProperty, I simply add a TypeConverterAttribute on the getter/setter and it works. Like this (idea from here):

[TypeConverter(typeof(DateTimeTypeConverter))]
public DateTime MyDate
{
    get { return (DateTime)GetValue(MyDateProperty); }
    set { SetValue(MyDateProperty, value); }
}

But with an attached DP, there is no getter/setter. What can I do to be able to write the string date in XAML ?

Thanks !

  • 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-16T14:02:52+00:00Added an answer on May 16, 2026 at 2:02 pm

    But attached properties have a Get accessor–have you tried putting the type converter on the Get accessor?

    Sorry about the version-specific link, it’s the one that contains the pertinent information. From that page:

    3 . You can attribute a type-level TypeConverter on the type that serves as the value type. This enables string conversion of all values of the type. For more information, see TypeConverters and XAML.

    4 . You can attribute a property-level TypeConverter on the Get accessor method. This enables string conversion of the attached property. Applying TypeConverterAttribute to the Get accessor method rather than the Set accessor method may seem nonintuitive, but that is where XAML processors expect to find the type conversion information (if any) for an attached property. For more information, see TypeConverters and XAML.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I write this jQuery more efficiently? The goal is to be able
So this is what I'd like to be able to write: cur_loc = min(open_set,key=lambda
Longtime reader, first-time poster here. My goal: To be able to take advantage of
My goal is to be able to call functions that are inside my JQuery
My goal is to be able to have the user select a range of
The goal is to be able to add a PDF file to the assets
My goal is to write a program that handles an arbitrary number of tasks
My goal is to write a custom camera view controller that: Can take photos
The goal is to be able to pronounce something like wo3. System.Speech can handle
This is the general goal I am trying to achieve: My VB.NET program will

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.