Whilst using the InkCanvas in an app I'm currently developing I found after moving between pages that had InkCanvases on them the app would crash with a Xaml Parse Exception. It seemed random, however I created a simple app to get rid of as many variables that could be causing this. I added 2 pages to move between with multiple (10) InkCanvases on the second page. The app consistently crashes after moving back and forth between the pages 10 or more times. Below I have added my simple test pages.
Page 1:
<Page>
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Button Content="Navigate"
Click="ButtonBase_OnClick"/>
</Grid>
</Page>
Page 1 Code behind:
public sealed partial class MainPage : Page {
private Frame rootFrame;
public MainPage() {
this.InitializeComponent();
rootFrame = Window.Current.Content as Frame;
}
private void ButtonBase_OnClick(object sender, RoutedEventArgs e) {
rootFrame.Navigate(typeof (PageTwo));
}
}
Page 2:
<Page>
<StackPanel>
<TextBlock Text="Sign 1"/>
<InkCanvas Width="100"
Height="100"/>
<TextBlock Text="Sign 2"/>
<InkCanvas Width="100"
Height="100"/>
<!-- Another 8 InkCanvases -->
</StackPanel>
</Page>
I checked the memory profiler to see if the InkCanvases or pages were being held onto in memory but from what I could see they weren't.
Has anyone else experienced this issue? Or is there any known workaround?