xaml에 이상한 문제가 있습니다. wp 용 Visual Studio에서는 xaml이 유효하지 않다고 알려주지 만 앱을 실행하면 제대로 작동합니다.이 Xaml은 유효하지 않습니다 ... 이유를 이해하지 못합니다
<phone:PhoneApplicationPage
x:Class="Friends_And_Money.ContList"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Friends_And_Money"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
mc:Ignorable="d"
shell:SystemTray.IsVisible="True">
<!--LayoutRoot è la griglia radice in cui viene inserito tutto il contenuto della pagina-->
<phone:PhoneApplicationPage.Resources>
<local:ContactPictureConverter x:Key="ImageConverter" />
<DataTemplate x:Key="AddrBookGroupHeaderTemplate">
<Border Background="Transparent" Padding="5">
<Border Background="{StaticResource PhoneAccentBrush}" BorderBrush="{StaticResource PhoneAccentBrush}" BorderThickness="2" Width="62"
Height="62" Margin="0,0,18,0" HorizontalAlignment="Left">
<TextBlock Text="{Binding Key}" Foreground="{StaticResource PhoneForegroundBrush}" FontSize="48" Padding="6"
FontFamily="{StaticResource PhoneFontFamilySemiLight}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
</Border>
</Border>
</DataTemplate>
<phone:JumpListItemBackgroundConverter x:Key="BackgroundConverter"/>
<phone:JumpListItemForegroundConverter x:Key="ForegroundConverter"/>
<Style x:Key="AddrBookJumpListStyle" TargetType="phone:LongListSelector">
<Setter Property="GridCellSize" Value="113,113"/>
<Setter Property="LayoutMode" Value="Grid" />
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<Border Background="{Binding Converter={StaticResource BackgroundConverter}}" Width="113" Height="113" Margin="6" >
<TextBlock Text="{Binding Key}" FontFamily="{StaticResource PhoneFontFamilySemiBold}" FontSize="48" Padding="6"
Foreground="{Binding Converter={StaticResource ForegroundConverter}}" VerticalAlignment="Center"/>
</Border>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
<DataTemplate x:Key="AddrBookItemTemplate">
<StackPanel VerticalAlignment="Top" Margin="0,5,0,5">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5" ></ColumnDefinition>
<ColumnDefinition Width="auto" ></ColumnDefinition>
<ColumnDefinition Width="5" ></ColumnDefinition>
<ColumnDefinition Width="auto" ></ColumnDefinition>
</Grid.ColumnDefinitions>
<Image Source="{Binding Photo, Converter={StaticResource ImageConverter}}" Grid.Column="1" Width="62" Height="62" Stretch="Fill" />
<TextBlock Grid.Column="3" FontWeight="Light" FontSize="40" Text="{Binding FirstName}" />
</Grid>
</StackPanel>
</DataTemplate>
</phone:PhoneApplicationPage.Resources>
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contiene il nome dell'applicazione e il titolo della pagina-->
<StackPanel Grid.Row="0" Margin="12,17,0,28">
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/>
<TextBlock Text="{Binding Path=LocalizedResources.ContactTitle, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<!--ContentPanel - inserire ulteriore contenuto qui-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<phone:LongListSelector x:Name="LongList"
Background="Transparent"
GroupHeaderTemplate="{StaticResource AddrBookGroupHeaderTemplate}"
ItemTemplate="{StaticResource AddrBookItemTemplate}"
JumpListStyle="{StaticResource AddrBookJumpListStyle}"
LayoutMode="List"
IsGroupingEnabled="true"
HideEmptyGroups ="true" />
</Grid>
</Grid>
</phone:PhoneApplicationPage>
I의 (a longlistselector의 차이) 튜토리얼을 따라 여기에서 한 : [http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh286418(v=vs .105) .aspx] [1]
어떻게하면 좋을지, longlistselector는 이미지와 연락처 이름을 보여줍니다.
구조체를 표시합니다 : 도움이 모든 일에
namespace Friends_And_Money
{
class ContactStruct
{
public string FirstName
{
get;
set;
}
public WriteableBitmap Photo
{
get;
set;
}
public ContactStruct(string name, WriteableBitmap photo)
{
this.FirstName = name;
this.Photo = photo;
}
}
}
감사합니다.
새로운 세부 정보 : 오류는 datatemplate AddrBookItemTemplate에 서명되어 있으며 이미지 원본 특성을 남겨두면 오류가 사라진다는 점에 유의했습니다. 그래서 바인딩이있는 것처럼 보입니다.
먼저 답장을 보내 주셔서 감사합니다. wp에 대한 나의 첫 번째 접근 방식이며이 이상한 방법으로 시작되었습니다. 그들이 "xaml not valid"메시지에 대해 내 앱을 거부 할 위험은 없습니다. –
디자이너는 현실을 전혀 반영하지 않습니다. –