2016-04-10 17 views
0

Yeni platformla çalışmaya çalışıyorum ancak bir nedenden dolayı uygulamayı birkaç kez çalıştırdıktan sonra, öğelerini göstermeyecek. Sanki başka bir element ekliyorum ve hiçbir şey göstermiyormuş gibi. Her şeyi silmeyi ve sıfırdan başlamayı denedim, ama aynı şeyi yapıyor. Temayı Koyu olarak değiştirsem bile, en az bir öğe göstermek yerine uygulama boş kalır. Derleyici de hata göstermiyor. Benim asıl sayfası: En Arkaplan Black bağlıdır ve Yazı Ön plan da Siyah olduğundanUWP Uygulaması, ana görünümü görüntülemiyor

<Page 
x:Class="WDRPCIV.MainPage" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:local="using:WDRPCIV" 
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
mc:Ignorable="d"> 

<Grid Background="{ThemeResource ApplicationForegroundThemeBrush}"> 
    <Grid.RowDefinitions> 
     <RowDefinition Height="Auto"/> 
     <RowDefinition Height="*"/> 
    </Grid.RowDefinitions> 
    <RelativePanel> 
     <Button Width="40" Height="40" Background="{ThemeResource SystemControlForegroundAccentBrush}" Name="RootHamburger" FontFamily="Segoe MDL2 Assets" Content="&#xE700;" FontSize="20" Click="EvenimentMeniu"/> 
     <TextBlock x:Name="textBlock" Text="YOLOSWAG" FontSize="16" Margin="50,13,0,0"/> 
    </RelativePanel> 
    <SplitView Name="ListaNavigare" Grid.Row="1" DisplayMode="CompactOverlay" OpenPaneLength="200" CompactPaneLength="40" HorizontalAlignment="Left"> 
     <SplitView.Pane> 
      <ListBox SelectionMode="Single" Name="Iconite" SelectionChanged="SchimbareFereastra"> 
       <ListBoxItem> 
        <StackPanel Orientation="Horizontal"> 
         <TextBlock FontFamily="Segoe MDL2 Assets" FontSize="18" Text="&#xE71D;"></TextBlock> 
         <TextBlock Text="Selectare Categorie" FontSize="14" Margin="20,0,0,0"></TextBlock> 
        </StackPanel> 
       </ListBoxItem> 
       <ListBoxItem> 
        <StackPanel Orientation="Horizontal"> 
         <TextBlock FontFamily="Segoe MDL2 Assets" FontSize="18" Text="&#xE16D;"></TextBlock> 
         <TextBlock Text="Incepere Chestionar" FontSize="14" Margin="20,0,0,0"></TextBlock> 
        </StackPanel> 
       </ListBoxItem> 
       <ListBoxItem> 
        <StackPanel Orientation="Horizontal" GotFocus="StackPanel_GotFocus"> 
         <TextBlock FontFamily="Segoe MDL2 Assets" FontSize="18" Text="&#xE115;"></TextBlock> 
         <TextBlock Text="Despre" FontSize="14" Margin="20,0,0,0"></TextBlock> 
        </StackPanel> 
       </ListBoxItem> 
      </ListBox> 
     </SplitView.Pane> 
    </SplitView> 
</Grid> 

cevap

1

uygulama Boş kalır. İkinci olarak, Splitview'i daha iyi kullanmanız için, Hamburger'de ilk önce iki şey yapmanız gerekir. Tıklayın, eğer içerik, Splitview.Content altında İçeriğinizi tanımlamakla birlikte kapatılmışsa, splitview panelini açmanız gerekir.
Burada güncellenmiş XAML kopyalayıp yapıştırın ve farkı bulacaksınız.

<Grid Background="{ThemeResource ApplicationForegroundThemeBrush}"> 
     <Grid.RowDefinitions> 
      <RowDefinition Height="Auto"/> 
      <RowDefinition Height="*"/> 
     </Grid.RowDefinitions>  
     <RelativePanel> 
      <Button Width="40" Height="40" Background="{ThemeResource SystemControlForegroundAccentBrush}" Name="RootHamburger" FontFamily="Segoe MDL2 Assets" Content="&#xE700;" FontSize="20" Click="EvenimentMeniu"/> 
      <TextBlock x:Name="textBlock" Text="YOLOSWAG" Foreground="White" FontSize="16" Margin="50,13,0,0"/>   
     </RelativePanel> 
     <SplitView Name="ListaNavigare" Grid.Row="1" DisplayMode="CompactOverlay" OpenPaneLength="200" CompactPaneLength="40" HorizontalAlignment="Left"> 
      <SplitView.Pane> 
       <ListBox SelectionMode="Single" Name="Iconite" > 
        <ListBoxItem> 
         <StackPanel Orientation="Horizontal"> 
          <TextBlock FontFamily="Segoe MDL2 Assets" FontSize="18" Text="&#xE71D;"></TextBlock> 
          <TextBlock Text="Selectare Categorie" FontSize="14" Margin="20,0,0,0"></TextBlock> 
         </StackPanel> 
        </ListBoxItem> 
        <ListBoxItem> 
         <StackPanel Orientation="Horizontal"> 
          <TextBlock FontFamily="Segoe MDL2 Assets" FontSize="18" Text="&#xE16D;"></TextBlock> 
          <TextBlock Text="Incepere Chestionar" FontSize="14" Margin="20,0,0,0"></TextBlock> 
         </StackPanel> 
        </ListBoxItem> 
        <ListBoxItem> 
         <StackPanel Orientation="Horizontal"> 
          <TextBlock FontFamily="Segoe MDL2 Assets" FontSize="18" Text="&#xE115;"></TextBlock> 
          <TextBlock Text="Despre" FontSize="14" Margin="20,0,0,0"></TextBlock> 
         </StackPanel> 
        </ListBoxItem> 
       </ListBox> 
      </SplitView.Pane> 
      <SplitView.Content> 
       <Grid Background="Green" Width="550" > 
        <TextBlock Text="Your Content"/> 
       </Grid> 
      </SplitView.Content> 
     </SplitView> 
    </Grid> 

Ayrıca bölmesini açmak kod ekledik hamburger düğmeye tıklama olayı içinde olup emin olun.

private void EvenimentMeniu(object sender, RoutedEventArgs e) 
     { 
      ListaNavigare.IsPaneOpen = true; 
     } 
İlgili konular