码迷,mamicode.com
首页 > 其他好文 > 详细

关于UWP数据绑定的一个坑 x:bind修改为binding

时间:2017-07-26 22:07:47      阅读:204      评论:0      收藏:0      [点我收藏+]

标签:height   match   block   ges   efi   alignment   识别   绑定   panel   

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

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="100"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <StackPanel Grid.Row="0">
            <ProgressBar Name="myProressBar" Maximum="100" Minimum="0" Value="100" Height="20" Foreground="blue"/>
            <TextBlock Name="InstructionTextBlock" Text="" Foreground="Blue" HorizontalAlignment="Center"/>
            <MediaElement Name="MyMediaElement" AutoPlay="True"/>
        </StackPanel>
        <StackPanel Grid.Row="1" Orientation="Vertical">
            <GridView Name="SongGridView"
                      ItemsSource="{Binding Songs}"
                      IsItemClickEnabled="True"
                      ItemClick="SongGridView_OnItemClick">
                <GridView.ItemTemplate>
                    <DataTemplate>
                        <Grid>
                            <Image Name="AlbumArtImage"
                      Height="70"
                      Width="75"
                      Source="{Binding AlbumCover}"/>  <!--这里的x:bind修改为Binding识别属性值  这是一个坑请注意>
                        </Grid>
                    </DataTemplate>
                </GridView.ItemTemplate>
            </GridView>

        </StackPanel>
        <Button Click="ButtonBase_OnClick" Content="Click Me"/>
    </Grid>
</Page>

 

 

技术分享

 

关于UWP数据绑定的一个坑 x:bind修改为binding

标签:height   match   block   ges   efi   alignment   识别   绑定   panel   

原文地址:http://www.cnblogs.com/zuqiu888/p/7241659.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!