How to Free RAM at Silverlight/WPF ? I define a UserControl MyUC that has a Image and three Textblock. I add 10000 MyUCs to a Grid, then clear the Grid s Children,but RAM is not Freed! Why? MyUC:
<Grid x:Name="LayoutRoot" Background="White">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="32"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Image Grid.Column="0" Source="{Binding ICO}" Width="32" Height="32"/>
<StackPanel Grid.Column="1" Orientation="Vertical" Width="359" Margin="0,0,-189,0">
<TextBlock Text="{Binding ID}"/>
<TextBlock Text="{Binding Name}"/>
<TextBlock Text="{Binding URL}"/>
</StackPanel>
</Grid>
法典:
MyUC uc = null;
for (int i = 0; i < 10000; i++)
{
uc = new MyUC();
this.LayoutRoot.Children.Clear();
this.LayoutRoot.Children.Add(uc);
}
帮助我? 3KS!