Note that there are some explanatory texts on larger screens.

plurals
  1. POItemList Disappearing on Snapping to side
    primarykey
    data
    text
    <p>My Code is below, for some reason when i snap the window to any side(left or right) something weird happens and the stuff in the ListView Disappears. I'm quite sure something's going wrong in the xaml, but i can't figure out what :/</p> <pre><code>&lt;common:LayoutAwarePage x:Name="pageRoot" x:Class="Jeans.reader" 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:Jeans" xmlns:common="using:Jeans.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;!-- Collection of items displayed by this page --&gt; &lt;CollectionViewSource x:Name="itemsViewSource" Source="{Binding Items}"/&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;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition x:Name="primaryColumn" Width="610"/&gt; &lt;ColumnDefinition Width="*"/&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;!-- Back button and page title --&gt; &lt;Grid x:Name="titlePanel"&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 DefaultViewModel.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;!-- Vertical scrolling item list --&gt; &lt;ListView x:Name="itemListView" AutomationProperties.AutomationId="ItemsListView" AutomationProperties.Name="Items" TabIndex="1" Grid.Row="1" Margin="-10,-10,0,0" Padding="120,0,0,60" ItemsSource="{Binding Source={StaticResource itemsViewSource}}" IsSwipeEnabled="False" SelectionChanged="ItemListView_SelectionChanged" ItemTemplate="{StaticResource Standard130ItemTemplate}" SelectionMode="None" ItemClick="itemListView_ItemClick" IsItemClickEnabled="True"/&gt; &lt;!-- Details for selected item --&gt; &lt;ScrollViewer x:Name="itemDetail" AutomationProperties.AutomationId="ItemDetailScrollViewer" Grid.Column="1" Grid.RowSpan="2" Padding="70,0,120,0" DataContext="{Binding SelectedItem, ElementName=itemListView}" Style="{StaticResource VerticalScrollViewerStyle}"&gt; &lt;Grid x:Name="itemDetailGrid" Margin="0,60,0,50"&gt; &lt;WebView x:Name="detailsWeb"/&gt; &lt;/Grid&gt; &lt;/ScrollViewer&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="FullScreenLandscapeOrWide"/&gt; &lt;!-- Filled uses a simpler list format in a narrower column --&gt; &lt;VisualState x:Name="FilledOrNarrow"&gt; &lt;Storyboard&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="primaryColumn" Storyboard.TargetProperty="Width"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="420"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemListView" Storyboard.TargetProperty="ItemTemplate"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource Standard80ItemTemplate}"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemDetail" Storyboard.TargetProperty="Padding"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="60,0,66,0"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;/Storyboard&gt; &lt;/VisualState&gt; &lt;!-- The page respects the narrower 100-pixel margin convention for portrait, and the page initially hides details to show only the list of items --&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;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemDetail" Storyboard.TargetProperty="Visibility"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemListView" Storyboard.TargetProperty="Padding"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="100,0,90,60"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;/Storyboard&gt; &lt;/VisualState&gt; &lt;!-- When an item is selected in portrait the details display requires more extensive changes: * Hide the master list and the column is was in * Move item details down a row to make room for the title * Move the title directly above the details * Adjust margins and padding for details --&gt; &lt;VisualState x:Name="FullScreenPortrait_Detail"&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;ObjectAnimationUsingKeyFrames Storyboard.TargetName="primaryColumn" Storyboard.TargetProperty="Width"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="0"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemListView" Storyboard.TargetProperty="Visibility"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemDetail" Storyboard.TargetProperty="(Grid.Row)"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="1"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemDetail" Storyboard.TargetProperty="(Grid.RowSpan)"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="1"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="titlePanel" Storyboard.TargetProperty="(Grid.Column)"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="1"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemDetailGrid" Storyboard.TargetProperty="Margin"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="0,0,0,60"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemDetail" Storyboard.TargetProperty="Padding"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="100,0,90,0"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;/Storyboard&gt; &lt;/VisualState&gt; &lt;!-- The back button and title have different styles when snapped, and the page initially hides details to show only the list of items --&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;ObjectAnimationUsingKeyFrames Storyboard.TargetName="primaryColumn" Storyboard.TargetProperty="Width"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="320"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemDetail" Storyboard.TargetProperty="Visibility"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemListView" Storyboard.TargetProperty="ItemTemplate"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource Standard80ItemTemplate}"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemListView" Storyboard.TargetProperty="Padding"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="20,0,0,0"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;/Storyboard&gt; &lt;/VisualState&gt; &lt;!-- When snapped and an item is selected the details display requires more extensive changes: * Hide the master list and the column is was in * Move item details down a row to make room for the title * Move the title directly above the details * Adjust margins and padding for details * Use a different font for title and subtitle * Adjust margins below subtitle --&gt; &lt;VisualState x:Name="Snapped_Detail"&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;ObjectAnimationUsingKeyFrames Storyboard.TargetName="primaryColumn" Storyboard.TargetProperty="Width"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="0"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemListView" Storyboard.TargetProperty="Visibility"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemDetail" Storyboard.TargetProperty="(Grid.Row)"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="1"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemDetail" Storyboard.TargetProperty="(Grid.RowSpan)"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="1"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="titlePanel" Storyboard.TargetProperty="(Grid.Column)"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="1"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;!--&lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemDetailTitlePanel" Storyboard.TargetProperty="(Grid.Row)"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="0"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemDetailTitlePanel" Storyboard.TargetProperty="(Grid.Column)"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="0"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt;--&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemDetail" Storyboard.TargetProperty="Padding"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="20,0,20,0"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemDetailGrid" Storyboard.TargetProperty="Margin"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="0,0,0,60"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;!--&lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemTitle" Storyboard.TargetProperty="Style"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TitleTextStyle}"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemTitle" Storyboard.TargetProperty="Margin"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="0"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemSubtitle" Storyboard.TargetProperty="Style"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource CaptionTextStyle}"/&gt; &lt;/ObjectAnimationUsingKeyFrames&gt;--&gt; &lt;/Storyboard&gt; &lt;/VisualState&gt; &lt;/VisualStateGroup&gt; &lt;/VisualStateManager.VisualStateGroups&gt; &lt;/Grid&gt;&lt;/common:LayoutAwarePage&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload