```
```
public MainWindow()
{
InitializeComponent();
this.Loaded += (sender, args) =>
{
// Remove the MapView from the Layout
GridLayout.Children.Remove(MyMapView);
MyMapView.Width = MyMapView.Height = 300;
// Add the MapView to a Fixed Page
var fixedPage = new FixedPage { Width = 300, Height = 300 };
fixedPage.Children.Add(MyMapView);
GridLayout.Children.Remove(listBox);
listBox.Width = listBox.Height = 300;
fixedPage.Children.Add(listBox);
// Add the FixedPage to the PageContent
var pageContent = new PageContent { Child = fixedPage };
// Add the PageContent to the FixedDocument
MyFixedDocument.Pages.Add(pageContent);
};
}
```"/>
アプリで不具合の更新を取得する
URL がコピーされましたURL の共有
不具合
ArgumentNullException is returned when hosting MapView in Microsoft DocumentView control for client side printing.
Appears to be a bug in FixedDocument. Suggested workaround:
```
Code will move MapView from here and place it in the above DocumentViewer. The user wants to be able to print the map but the application always throws an ArgumentNullException.
```
```
public MainWindow()
{
InitializeComponent();
this.Loaded += (sender, args) =>
{
// Remove the MapView from the Layout
GridLayout.Children.Remove(MyMapView);
MyMapView.Width = MyMapView.Height = 300;
// Add the MapView to a Fixed Page
var fixedPage = new FixedPage { Width = 300, Height = 300 };
fixedPage.Children.Add(MyMapView);
GridLayout.Children.Remove(listBox);
listBox.Width = listBox.Height = 300;
fixedPage.Children.Add(listBox);
// Add the FixedPage to the PageContent
var pageContent = new PageContent { Child = fixedPage };
// Add the PageContent to the FixedDocument
MyFixedDocument.Pages.Add(pageContent);
};
}
```