Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
画像を表示するSystem.Windows.Controls.Controlのインスタンスが必要です。しかし、私が持っているのは画像ソースだけです。
使うことができます
var image = new Image(); image.Source = imageSource;
ただし、ImageがControls名前空間にあることに加えて、Image自体はControlから派生していません。
Imagesourceをプログラムでコントロールに取り込む簡単な方法はありますか?
ContentControlでラップすることができます。
ContentControl cc = new ContentControl(); cc.Content = image;
しかし、なぜコントロールが必要なのか、私は本当に興味があります。