おそらくここで単純なものが欠けているのでしょうが、キャンバスに含まれるアイテムから添付プロパティを削除する方法が見つかりません。
コード例:
//Add an image to a canvas; set the location to the top
theCanvas.Children.Add(theImage);
Canvas.SetTop(theImage, 0);
//Move the image to the bottom of the canvas
Canvas.SetBtoom(theImage, 0);
Top 添付プロパティは Bottom 添付プロパティよりも優先されるため、これは機能しません。そのため、一番上の添付プロパティを「設定解除」しようとします
//Move the image to the bottom of the canvas
Canvas.SetTop(theImage, DependencyProperty.UnsetValue);
Canvas.SetBtoom(theImage, 0);
...そしてコンパイラは、UnsetValue を double に変換できないと不平を言います。
ここで何が欠けていますか? Top 添付プロパティを削除するにはどうすればよいですか?