How to write an image control
<Grid X: Name = "contentpanel" grid. Row = "1" margin = "12,0, 12,0">
<Image name = "IMG"/>
</GRID>
You can call the system. Windows. Controls. Control. manipulationstarted event to overwrite system. Windows. uielement. onmanipulationstarted (system. Windows. Input. manipulationstartedeventargs ).
Attach network image resources
Protected override void onmanipulationstarted (manipulationstartedeventargs ARGs)
{
Uri uri = new uri ("http://www.website.com/image/a.jpg ");
Bitmapimage BMP = new bitmapimage (URI );
IMG. Source = BMP;
Args. Complete ();
Args. Handled = true;
Base. onmanipulationstarted (ARGs );
}
Load local image resources
Protected override void onmanipulationstarted (manipulationstartedeventargs ARGs)
{
Uri uri = new uri ("../images/hello.png", urikind. Relative );
Streamresourceinfo resourceinfo = application. getresourcestream (URI );
Bitmapimage BMP = new bitmapimage ();
BMP. setsource (resourceinfo. Stream );
IMG. Source = BMP;
Args. Complete ();
Args. Handled = true;
Base. onmanipulationstarted (ARGs );
}
Form top