private void Image_SizeChanged(object sender, SizeChangedEventArgs e) { if (null == m_Scene) { return; } int iWidth = (int)image.ActualWidth; int iHeight = (int)image.ActualHeight; if (iWidth == 0 || iHeight == 0) { return; } m_Scene.Resize(iWidth, iHeight); }