Search

Blend crashes due to custom elements with a FontFamily property by lexapilot

Active

1
0
Sign in
to vote
Type: Bug
ID: 777230
Opened: 1/23/2013 1:37:41 AM
Access Restriction: Public
1
Workaround(s)
1
User(s) can reproduce this bug
If a WPF project is loaded into Blend and a XAML file is opened that contains a CustomElement (inheriting FrameworkElement) with a userdefined DependencyProperty of type FontFamily and this element is selected so that the FontFamily property of the CustomElement is visible within Blend's PropertyPane, Blend will crash if you close the XAML file.

Obviously the crash comes from Blend's FontFamilyValueEditor within the PropertyPane.

As this behaviour doesn't occur if we use e.g. a TextBlock element instead of my CustomElement, the question is: What is the difference?

If Blend is attached to the VisualStudio debugger while it's crashing, a NullReferenceException can be observed.
The stack trace is attached to this feedback.
Details (expand)

Product?

Blend

Product Version?

 

Blend 4 SP1 (4.0.20901.0)

Issue Type?

Bug

Repro Steps? (N/A for Suggestion)

1. Start Visual Studio and create a new WPF-Application project

2. Add a new class "CustomElement", that inherits FrameworkElement to the project

3. Add "MyFontFamily" as DependencyProperty of type FontFamily to the class "CustomElement"

4. Add a "CustomElement" as child to the root Grid of the MainWindow. The CustomElement will not have any visible parts, but this doesn't matter for this test

5. Compile, run and stop the app only to be sure no compiler or runtime error occurs.

6. Now open the project with Expression Blend 4.

7. In Blend open "MainWindow.xaml" and select the "CustomElement" so that you can see it's properties in Blend's PropertyPane.

8. Ensure, that the CustomElement's property "MyFontFamily" is visible within Blend's PropertyPane. The containing category MUST NOT be collapsed.

9. At this point close the "MainWindow.xaml" file within Blend. The result is that Blend will crash.

You can also use the attached sample project to repro this bug.
File Attachments
File Name Submitted By Submitted On File Size  
ExceptionStackTrace.txt 1/23/2013 7 KB
WpfApplication1.zip 1/23/2013 7 KB
Sign in to post a comment.
Posted by Harikrishna Menon on 1/28/2013 at 12:21 PM
Blend for Visual Studio 2012 released with only support for Window's Store Apps. We also released a Preview for Silverlight 5 and WPF 4.5 at the same time. VS will be releasing its Update 2 in February. As a part of the Update will be releasing RTM version of Blend for WPF 4.5 and Silverlight 5. This build show fix this issue. Please try this out and let us know if it fixes your problem. Hope that clarifies your issue. If not please feel free to contact me directly at harikm@microsoft.com for more details.
Posted by lexapilot on 1/26/2013 at 11:49 AM
What? RTM version of Blend 5 in Update 2 of Visual Studio??? :-o
Doesn't understand! Please clarify.
Posted by Microsoft on 1/25/2013 at 1:39 PM
Hi Lexapilot,
             Thanks for reporting this issue. This looks to be fixed in Blend 5. Currently there is a preview available, the RTM version will be available in Update 2 of Visual Studio.
Regards
Hari
Sign in to post a workaround.
Posted by lexapilot on 1/23/2013 at 1:46 AM
If you deselect the CustomElement mentioned above, by selecting e.g. a different element or selecting the root element BEFORE closing the XAML file within Blend, the crash doesn't occur.