title: Why did my XAML suddenly crash?
body: <p>I added a "Basic Page" to my project in a folder ("View") that I created within the project.</p>
  
  <p>At first all was well, but "all of a sudden" the design view failed and displayed:</p>
  
  <p><em>System.ObjectDisposedException
  Safe handle has been closed</em></p>
  
  <p>This is the XAML (I hadn't changed a thing in the default XAML generated yet):</p>
  
  <pre><code>&lt;common:LayoutAwarePage
      x:Name="pageRoot"
      x:Class="TimeAndSpaceLines.View.SectionPage"
      DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="using:TimeAndSpaceLines.View"
      xmlns:common="using:TimeAndSpaceLines.Common"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      mc:Ignorable="d"&gt;
  
      &lt;Page.Resources&gt;
  
          &lt;!-- TODO: Delete this line if the key AppName is declared in App.xaml --&gt;
          &lt;x:String x:Key="AppName"&gt;My Application&lt;/x:String&gt;
      &lt;/Page.Resources&gt;
  
      &lt;!--
          This grid acts as a root panel for the page that defines two rows:
          * Row 0 contains the back button and page title
          * Row 1 contains the rest of the page layout
      --&gt;
      &lt;Grid Style="{StaticResource LayoutRootStyle}"&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="140"/&gt;
              &lt;RowDefinition Height="*"/&gt;
          &lt;/Grid.RowDefinitions&gt;
  
          &lt;!-- Back button and page title --&gt;
          &lt;Grid&gt;
              &lt;Grid.ColumnDefinitions&gt;
                  &lt;ColumnDefinition Width="Auto"/&gt;
                  &lt;ColumnDefinition Width="*"/&gt;
              &lt;/Grid.ColumnDefinitions&gt;
              &lt;Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/&gt;
              &lt;TextBlock x:Name="pageTitle" Grid.Column="1" Text="{StaticResource AppName}" Style="{StaticResource PageHeaderTextStyle}"/&gt;
          &lt;/Grid&gt;
  
          &lt;VisualStateManager.VisualStateGroups&gt;
  
              &lt;!-- Visual states reflect the application's view state --&gt;
              &lt;VisualStateGroup x:Name="ApplicationViewStates"&gt;
                  &lt;VisualState x:Name="FullScreenLandscape"/&gt;
                  &lt;VisualState x:Name="Filled"/&gt;
  
                  &lt;!-- The entire page respects the narrower 100-pixel margin convention for portrait --&gt;
                  &lt;VisualState x:Name="FullScreenPortrait"&gt;
                      &lt;Storyboard&gt;
                          &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style"&gt;
                              &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/&gt;
                          &lt;/ObjectAnimationUsingKeyFrames&gt;
                      &lt;/Storyboard&gt;
                  &lt;/VisualState&gt;
  
                  &lt;!-- The back button and title have different styles when snapped --&gt;
                  &lt;VisualState x:Name="Snapped"&gt;
                      &lt;Storyboard&gt;
                          &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style"&gt;
                              &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/&gt;
                          &lt;/ObjectAnimationUsingKeyFrames&gt;
                          &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style"&gt;
                              &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/&gt;
                          &lt;/ObjectAnimationUsingKeyFrames&gt;
                      &lt;/Storyboard&gt;
                  &lt;/VisualState&gt;
              &lt;/VisualStateGroup&gt;
          &lt;/VisualStateManager.VisualStateGroups&gt;
      &lt;/Grid&gt;
  &lt;/common:LayoutAwarePage&gt;
  </code></pre>
  
  <p>Note: I did try removing the "appname" line according to the "TODO" (it <em>is</em> in app.xaml) but that made no difference. The app builds successfully via F6, but attempts to reload the designer fail.</p>
  
  <p>A second attempt, this time using a Blank xaml page, and then pasting in some XAML I had cobbled together in Kaxaml, also fails, this time with the err msg: "<em>System.Exception
  Package could not be registered. (Exception from HRESULT: 0x80073CF6)</em>"</p>
  
  <p>This XAML is (truncated):</p>
  
  <pre><code>&lt;Page
      x:Class="TimeAndSpaceLines.View.SectionN"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="using:TimeAndSpaceLines.View"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      mc:Ignorable="d"&gt;
  
      &lt;Grid MinHeight="600" ShowGridLines="True" Background="{StaticResource ApplicationPageBackgroundThemeBrush}"&gt;
                  &lt;Grid.ColumnDefinitions&gt;
                      &lt;ColumnDefinition Width="320"&gt;
                      &lt;/ColumnDefinition&gt;
                      &lt;ColumnDefinition MaxWidth="800"&gt;
                      &lt;/ColumnDefinition&gt;
                  &lt;/Grid.ColumnDefinitions&gt;
                  &lt;Grid.RowDefinitions&gt;
                      &lt;RowDefinition&gt;
                      &lt;/RowDefinition&gt;
      . . .
  </code></pre>
  
  <p>???</p>