The following code crashes on the highlighted line with catastrophic failure
0x8000FFFF. All I'm doing is looping to create items for an Accordion
control. It's just dying when I assign the (non null) Style to the second
Textbox. Anyone tried this sort of thing before?  - Greg

 

 

<Style x:Key="ItemHeaderTextStyle" TargetType="TextBlock">

  <Setter Property="FontSize" Value="16"/>

  <Setter Property="Foreground" Value="Black"/>

</Style>

<Style x:Key="ItemContentTextStyle" TargetType="TextBlock">

  <Setter Property="FontSize" Value="12"/>

  <Setter Property="Foreground" Value="Gray"/>

  <Setter Property="Margin" Value="12,8,8,8"/>

  <Setter Property="TextWrapping" Value="Wrap"/>

</Style>

 

[cut]

 

accordNavigate.Items.Clear();

string[] titles = new string[] { "Labels", "Cells", "Significance",
"Titles", "Vectors" };

for (int i = 0; i <titles.Length; i++)

{

       AccordionItem item = new AccordionItem();

       TextBlock headerText = new TextBlock();

       headerText.Text = titles[i];

       headerText.Style = (Style)this.Resources["ItemHeaderTextStyle"];

       item.Header = headerText;

       TextBox contextText = new TextBox();

       contextText.Text = string.Format("This is the content of accordion
item No.{0}", i + 1);

       contextText.Style = (Style)this.Resources["ItemContentTextStyle"];;

       item.Content = contextText;

       accordNavigate.Items.Add(item);

}

 

_______________________________________________
ozsilverlight mailing list
ozsilverlight@ozsilverlight.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight

Reply via email to