博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
关于UWP数据绑定的一个坑 x:bind修改为binding
阅读量:6896 次
发布时间:2019-06-27

本文共 1804 字,大约阅读时间需要 6 分钟。

<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识别属性值  这是一个坑请注意<StackPanel Grid.Row="1" Orientation="Vertical">
            <GridView Name="SongGridView"
                      ItemsSource="{Binding Songs}"
                      IsItemClickEnabled="True"
                      ItemClick="SongGridView_OnItemClick">
                <GridView.ItemTemplate>
                    <DataTemplate x:DataType="data:Song">
                        <Grid>
                            <Image Name="AlbumArtImage"
                      Height="70"
                      Width="75"
                      Source="{x:Bind AlbumCover}"/>
                        </Grid>
                    </DataTemplate>
                </GridView.ItemTemplate>
            </GridView> 这里也可以这么写-->
                        </Grid>
                    </DataTemplate>
                </GridView.ItemTemplate>
            </GridView>

        </StackPanel>

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

 

 

 

转载于:https://www.cnblogs.com/zuqiu888/p/7241659.html

你可能感兴趣的文章
洛谷 P1525 关押罪犯==codevs 1069 关押罪犯[NOIP 2010]
查看>>
国密算法--Openssl 实现国密算法(加密和解密)
查看>>
经典智力题
查看>>
noip愤怒的小鸟&&vijos2008
查看>>
聚内核和微内核-转
查看>>
微软职位内部推荐-Principal DEV Manager for Bing Client
查看>>
for 循环
查看>>
Entity Framework技术系列之0:开篇
查看>>
201621123048《Java程序设计》第五周学习总结
查看>>
mac编辑器vim美化
查看>>
MD5摘要算法简析
查看>>
《30天自制操作系统》学习笔记一
查看>>
Python.tornado.2.tornado.options
查看>>
mysql关于or的索引问题
查看>>
初遇Linux
查看>>
onclick事件没有反应的五种可能情况
查看>>
vue----webpack----对vuex的理解
查看>>
08----mockjs处理前端传来的路径,获取?后面的值
查看>>
蓝桥杯 算法训练 最短路 [ 最短路 bellman ]
查看>>
修改 IIS6.0 时间格式的问题。
查看>>