2012-10-31 4 views
2

오늘 아침에 C#/XAML 앱을 다시 실행하려고했습니다 (이전에 언급 된 문제 : Why did my XAML suddenly crash?).Label이 유효한 XAML 요소가 아닙니까?

이번에는 적어도 "회원"ShowGridLines "이 (가) 인식되지 않거나 액세스 할 수없는 몇 가지 오류 메시지가 있습니다." 및 "레이블은 Windows App 프로젝트에서 지원되지 않습니다."

<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"> 

    <Grid MinHeight="600" ShowGridLines="True" Background="{StaticResource ApplicationPageBackgroundThemeBrush}"> 
      <Grid.ColumnDefinitions> 
       <ColumnDefinition Width="320"></ColumnDefinition> 
       <ColumnDefinition MaxWidth="800"></ColumnDefinition> 
      </Grid.ColumnDefinitions> 
      <Grid.RowDefinitions> 
<RowDefinition/>      
<RowDefinition/>      
<RowDefinition/>      
<RowDefinition/>      
<RowDefinition/>      
<RowDefinition/>      
<RowDefinition/>      
<RowDefinition/>      
<RowDefinition/>      
<RowDefinition/>      
<RowDefinition/>      
<RowDefinition/>      

      </Grid.RowDefinitions> 
      <StackPanel Orientation="Horizontal"> 
       <Label MinWidth="40" Content="From"></Label> 
       <TextBox x:Name="textBoxFromDate" MinWidth="120"> 
       </TextBox> 
      </StackPanel> 
      <StackPanel Grid.Row="1" Orientation="Horizontal"> 
       <Label MinWidth="40">at 
       </Label> 
       <TextBox x:Name="textBoxFromTime" MinWidth="120" Grid.Row="1"> 
       </TextBox> 
      </StackPanel> 
      <StackPanel Grid.Row="2" Orientation="Horizontal"> 
       <Label MinWidth="40">To 
       </Label> 
       <TextBox x:Name="textBoxToDate" MinWidth="120"> 
       </TextBox> 
      </StackPanel> 
      <StackPanel Grid.Row="3" Orientation="Horizontal"> 
       <Label MinWidth="40">at 
       </Label> 
       <TextBox x:Name="textBoxToTime" MinWidth="120" Grid.Row="1"> 
       </TextBox> 
      </StackPanel> 
      <Button 
     x:Name="buttonFindLocForDateRange" 
     MaxWidth="200" 
     Grid.Row="4" 
     Content="Find Location for Date Range"> 
      </Button> 
      <Label 
     x:Name="labelPerson1_Red" 
     Grid.Row="5" 
     Content="(Person1_Red)" 
     Foreground="Red"> 
      </Label> 
      <Label 
     x:Name="labelPerson2_Orange" 
     Grid.Row="6" 
     Content="(Person2_Orange)" 
     Foreground="Orange"> 
      </Label> 
      <Label 
     x:Name="labelPerson3_Yellow" 
     Grid.Row="7" 
     Content="(Person3_Yellow)" 
     Foreground="Yellow"> 
      </Label> 
      <Label 
     x:Name="labelPerson4_Green" 
     Grid.Row="8" 
     Content="(Person4_Green)" 
     Foreground="Green"> 
      </Label> 
      <Label 
     x:Name="labelPerson5_Blue" 
     Grid.Row="9" 
     Content="(Person5_Blue)" 
     Foreground="Blue"> 
      </Label> 
      <Label 
     x:Name="labelPerson6_Indigo" 
     Grid.Row="10" 
     Content="(Person6_Indigo)" 
     Foreground="Indigo"> 
      </Label> 
      <Label 
     x:Name="labelPerson7_Violet" 
     Grid.Row="11" 
     Content="(Person7_Violet)" 
     Foreground="Violet"> 
      </Label> 
      <StackPanel Grid.Column="1" Orientation="Horizontal"> 
       <Image> 
       </Image> 
       <Label>Prev 
       </Label> 
       <Label x:Name="labelSectionN" Content="(Section N)"> 
       </Label> 
       <Label>Next 
       </Label> 
      </StackPanel> 
      <!-- Add a Bing Map component: Grid.Column="1" Grid.Row="1" Grid.RowCount="11" --> 
     </Grid> 
</Page> 

주 : 여기

완전한 XAML 유일한 차이점은 XAML의 초기 및 공간 부인지되고 함께 단순히 본 :

<Page 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> 

... 그리고 거기 Grid 속성에서 Background = "{StaticResource ApplicationPageBackgroundThemeBrush}"인 경우이 XAML은 Kaxaml에서 (현재로서는 매우 추악하지만이 시점에서 예상되는대로) 표시해야합니다.

+0

이전 문제에 대한 링크가 없습니다. 또한,' 대신'RowDefinition />'과 같은 RowDefinition과 같은 태그를 자 닫을 수 있음을 알아 두십시오. – Basic

+0

감사합니다. 나는 링크를 추가 할 것이다 (때로는 나는 실종 된 링크라고 생각한다). 팁을 주셔서 감사합니다. –

+0

확실하게 - Windows Store (WinRT) 앱을 개발하고 있습니까? WPF 앱이 아닌가요? –

답변

2

WinRT가 아닌 WPF 응용 프로그램에서만 지원되는 일부 XAML을 작성했습니다.
WinRT에는 Label 컨트롤이없고 Grid에는 ShowGridLines 속성이 없으므로 코드가 제대로 작동하지 않습니다.

WPF와 WinRT는 두 가지 기술입니다. 두 가지 모두 사용자 인터페이스를 만드는 데 XAML을 사용하지만, WPF로 작성된 XAML은 WinRT에서 작동하고 그 반대도 마찬가지입니다.

관련 문제