void MainPage_SizeChanged(object sender, SizeChangedEventArgs e)
 {
     InvalidateSize();
     if (MainPageResized != null)
     {
         MainPageSizeChangedEventArgs args = new MainPageSizeChangedEventArgs();
         args.Width = this.ActualWidth;
         MainPageResized(this, args);
     }
 }
 void MainPage_SizeChanged(object sender, SizeChangedEventArgs e)
 {
     InvalidateSize();
     if (MainPageResized != null)
     {
         MainPageSizeChangedEventArgs args = new MainPageSizeChangedEventArgs();
         args.Width = this.ActualWidth;
         MainPageResized(this, args);
     }
 }