Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TextFormatter Exception
Message
From
09/02/2010 02:32:54
 
 
To
08/02/2010 17:35:29
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Environment versions
Environment:
C# 3.0
Miscellaneous
Thread ID:
01447906
Message ID:
01448298
Views:
45
>>Hi,
FormattedText ft = new FormattedText("Hello", CultureInfo.CurrentCulture, FlowDirection.LeftToRight,
>>new Typeface("Verdana"), 100, Brushes.Black);
>>double d = ft.MinWidth;
Second line throws a ArgumentNullException. Stack trace shows MS.Internal.TextFormatterImp.VerifyTextFormattingArguments(.....) Value cannot be null. Parameter name: textSource. Works fine IF DrawingContext.DrawText(ft,0,0) is executed between the two lines.
>>Anyone?
>
>That is really a weird one.
>
>What's even weirder... if I hover over and browse the properties for ft in vs... it doesn't throw the error.
>
>Thought it might be timing, but that wasn't it.
>
>I added an able to reproduce response to your bug report.

Thx. I also notices the behaviour you mention - inspecting the value in the debugger doesn't throw the exception and shows a valid double.
Guess we'll have to wait and see what MS say about this one :-{

Update: Just see MS has replied - fixed in .NET4. No workaround though......

Best,
Viv
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform