Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

In my program, I try override default value of NumberSubstitution.SubstitutionProperty for FrameworkElement, But i get this error:

{"PropertyMetadata is already registered for type 'FrameworkElement'."}

and my code here:

C#
NumberSubstitution.SubstitutionProperty.OverrideMetadata(typeof (FrameworkElement),
    new PropertyMetadata(NumberSubstitutionMethod.Traditional));


How can i override default value of NumberSubstitution.SubstitutionProperty ?

Thanks :)
Posted
Comments
Sergey Alexandrovich Kryukov 17-Mar-14 1:03am    
"Override a value" is nonsense. There is no such concept. You never override values, only the virtual methods or properties. Why would you need to "override" this value and what it would mean?
—SA
Moshtaba 17-Mar-14 1:26am    
Default value of NumberSubstitution.SubstitutionProperty is NumberSubstitutionMethod.AsCalture, and when i change DefaultThreadCurrentCulture and DefaultThreadCurrentUICulture of my application, for example to "fa-IR", on FlowDirection.LeftToRight WPF reject my calture NumberFormat unless in ui controls i set NumberSubstitution.SubstitutionProperty to NumberSubstitutionMethod.Traditional. i want to set this one time for all and dont want use Styles for this purpose

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900