This is a migrated thread and some comments may be shown as answers.

Exception While setting the Style

1 Answer 127 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rehmatullah
Top achievements
Rank 1
Rehmatullah asked on 14 Jul 2011, 02:31 PM
I am getting the following exception when i set the style of the RTB via Static Resource

Failed to assign to property 'System.Windows.FrameworkElement.Style


{System.Windows.Markup.XamlParseException: Failed to assign to property 'System.Windows.FrameworkElement.Style'. [Line: 149 Position: 185]
   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   at RadRichTextBoxTest.MainPage.InitializeComponent()
   at RadRichTextBoxTest.MainPage..ctor()}

1 Answer, 1 is accepted

Sort by
0
Alex
Telerik team
answered on 19 Jul 2011, 04:08 PM
Hi Rehmatullah,

Unfortunately we were unable to reproduce your problem. Here is the xaml we used:

<Grid>
    <Grid.Resources>
        <Style x:Key="richTextBoxStyle" TargetType="telerik:RadRichTextBox">
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="FontStyle" Value="Italic" />
            <Setter Property="DocumentInheritsDefaultStyleSettings" Value="True" />
        </Style>
    </Grid.Resources>
    <telerik:RadRichTextBox Style="{StaticResource richTextBoxStyle}" />
</Grid>

It would be helpful if you could send us an example project that shows the problem so that we can further investigate it.  Greetings,
Alex
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
RichTextBox
Asked by
Rehmatullah
Top achievements
Rank 1
Answers by
Alex
Telerik team
Share this question
or