Blend crash after adding a 'converter' to data binding (silverlight 2). RRS feed

  • Question

  • Hi All.
    I'm a developer doing my first steps in the silverlight 2.0 world.
    In my project , I have a text box that is bound to an object - everything is good .
    I wanted to add a converter to handle some cases. I added the proper class to the page resource and back to Blend .... I couldn't do it using the template wizard in Blend (converter class isn't 'found' ) so I went back to VS 2008. I added this code to the text box code binding text :  , Converter={StaticResource PriceConverter}
    The textbox code looks like this (see line 11) :

    The project works just fine. Both if I launch it from VS 2008 or Blend.
    1 <UserControl.Resources> 
    2         <AmazonSL08_Code:PriceValueConverter x:Key="PriceConverter" d:IsDataSource="True"/>  
    3         <DataTemplate x:Key="xyz">  
    4             <Grid Height="140" Width="842">  
    5                 <Grid.ColumnDefinitions> 
    6                     <ColumnDefinition Width="154.5"/>  
    7                     <ColumnDefinition Width="*"/>  
    8                 </Grid.ColumnDefinitions> 
    9                                 ...  
    10                      <TextBlock Height="Auto" Width="Auto" FontSize="14" Foreground="#FFA81212" Text="New Price : $ " TextWrapping="Wrap"/>  
    11                      <TextBlock FontSize="14" Foreground="#FFA81212" Text="{Binding Mode=OneWay, Path=NewPrice, Converter={StaticResource PriceConverter}}" TextWrapping="Wrap"/>  
    12 ...             </Grid> 
    13         </DataTemplate>       
    14     </UserControl.Resources> 
    But (and here's my question) , when I try to open the item template in Blend , I get this error message :
    "Blend has encountered an unrecoverable internal error and must close" .

    - what am I doing wrong ?
    - how can I work around this , so I can have my converters and edit my templates via Blend ?


    Sunday, December 21, 2008 9:02 PM

All replies

  • I was having the same problem as you and I took out the line in xaml for the converter and tried it in blend and it works.  I just hope that since there are two of us having the same problem that maybe someone can come up with an answer.


    Monday, February 9, 2009 9:49 PM
  • I'm getting the same error. My converter works fine in VS2008 but if I open the file in Blend it crashes, asking me if I want to save my work then kills Blend.

    If I change the name of the converter in the binding (throw an X on the end) then it fails silently and I can then open the file. Gets a little annoying though. Thought I must be doing something wrong with my bindings but they work as expected, only Blend is having the issue.
     Might try debugging Blend to see what its issue is.

    Monday, February 16, 2009 12:23 AM
  • Hi!

    I am having the same error in blend, is any one on to this in the Blend-team? or is anyone working on a wrapper to secure the error?
    Seems like a pretty common error and a very critical one to. Converters are a major advantage in the databinding.


    Hannes Larsson
    Thursday, February 19, 2009 11:47 AM