mycode :
Canvas myCanvas = new Canvas();
> Rectangle myRectangle = new Rectangle();
> Task.Factory.StartNew(() =>
> {
> while(true)
> {
> myCanvas.Children.Clear();
> //do something
> for(int i=1;i<=100;i++)
> {
> myCanvas.Children.Add(myRectangle[i]);
> }
}
> }).ContinueWith(t =>
> {
>
> }, System.Threading.CancellationToken.None, TaskContinuationOptions.None,
> TaskScheduler.FromCurrentSynchronizationContext());
I still got error : "Specified Visual is already a child of another Visual or the root of a CompositionTarget." what i should do?