This question is locked. New answers and comments are not allowed.
I found RadHtmlPlaceHolder control will crash if use with RadExpander. I create a small application to dup this error. Please see demo code.
If I expand the button on Tab1 and then quickly switch between tabs for several times. The application will more and more slow. Finally the error will happen.
If I use textBlock instead of RadHtmlPlaceHolder, the application will run correctly.
Any suggestions?
Thanks.
XAML:
| <UserControl x:Class="SilverlightApplication1.MainPage" |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| mc:Ignorable="d" |
| d:DesignHeight="400" d:DesignWidth="600" xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"> |
| <Grid x:Name="LayoutRoot" Background="White" Height="402" Width="641"> |
| <controls:TabControl Height="249" HorizontalAlignment="Left" Margin="29,28,0,0" Name="tabControl1" VerticalAlignment="Top" Width="350" SelectionChanged="tabControl1_SelectionChanged"> |
| <controls:TabItem Header="tabItem1" Name="tabItem1"> |
| </controls:TabItem> |
| <controls:TabItem Header="tabItem2" Name="tabItem2"> |
| </controls:TabItem> |
| </controls:TabControl> |
| </Grid> |
| </UserControl> |
C#:
| namespace SilverlightApplication1 |
| { |
| public partial class MainPage : UserControl |
| { |
| public MainPage() |
| { |
| InitializeComponent(); |
| } |
| private void tabControl1_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) |
| { |
| TabControl tc = sender as TabControl; |
| TabItem ti = tc.SelectedItem as TabItem; |
| Grid gr = new Grid(); |
| RadExpander ex = new RadExpander(); |
| ex.Header = "TestHeader"; |
| RadHtmlPlaceholder html = new RadHtmlPlaceholder(); |
| html.HtmlSource = "testHtmlSource"; |
| ex.Content = html; |
| //TextBlock tb = new TextBlock(); |
| //tb.Text = "testtextBlock"; |
| //ex.Content = tb; |
| gr.Children.Add(ex); |
| ti.Content = gr; |
| } |
| } |
| } |
