I have got problem while setting dependency property to XAML Element. XAML:
<local2:RichTextColumns xmlns:local2="using:App2.Common">
<local2:RichTextColumns.ColumnTemplate>
<DataTemplate x:Name="overflowControl1">
<RichTextBlockOverflow Width="1000" Margin="5,0,0,0"/>
</DataTemplate>
</local2:RichTextColumns.ColumnTemplate>
<RichTextBlock Foreground="Black" Width="1000">
<Paragraph>
</Paragraph>
</RichTextBlock>
</local2:RichTextColumns>
C#
var tmp = (DataTemplate)FindName("overflowControl1");
tmp.SetValue(RichTextBlockOverflow.ActualWidthProperty, 100);
It results in
Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)).
I have also tried using RichTextBlockOverflow.WidthProperty
Thank you in advance :)
ActualWidthproperty is not meant to be set, it's read-only - Thomas Levesquex:Name="overflowControl1"to theRichTextBlockOverflownot to theDataTemplate- S3ddi9