In WPF, when user maximize the window, i need to change also the size of map so the map still covers the whole area:
void Window1_StateChanged(object sender, EventArgs e)
{
if (Window1.WindowState == WindowState.Maximized)
{
wpfMap1.Width = MapGrid.ActualWidth;
wpfMap1.Height = MapGrid.ActualHeight;
wpfMap1.Refresh();
}
}
In doing so, the width and height of wpfMap1 are set correctly to the new width and height of the MapGrid that contains the map, but the map was not refreshed. i have to pan the map so it will be refreshed properly. What am i doing wrong?
Ric