找回密码
 立即注册

QQ登录

只需一步,快速开始

feiyan0320

中级会员

17

主题

70

帖子

615

积分

中级会员

积分
615

活字格认证微信认证勋章

QQ

[已处理] tile绑定数据

feiyan0320
中级会员   /  发表于:2015-10-13 13:56  /   查看:12905  /  回复:14


hi,数据不知如何绑定,请求帮忙

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

14 个回复

正序浏览
Alice
社区贡献组   /  发表于:2015-10-19 09:27:00
15#
回复 14楼feiyan0320的帖子

不用客气。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
feiyan0320
中级会员   /  发表于:2015-10-16 23:13:00
14#
回复 13楼Alice的帖子

ok,非常感谢
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2015-10-16 16:24:00
13#
回复 12楼feiyan0320的帖子

根据2楼d提示信息,对瓷片的背景色和文字都做了绑定,请看示例。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

评分

参与人数 1满意度 +5 收起 理由
feiyan0320 + 5 已解决,我真的是不太会用,多谢版主

查看全部评分

请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
feiyan0320
中级会员   /  发表于:2015-10-15 18:03:00
12#
回复 11楼Alice的帖子

费心了
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2015-10-15 17:55:00
11#
回复 10楼feiyan0320的帖子

好的。
我会根据你的代码再帮你看看,然后给你反馈。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
feiyan0320
中级会员   /  发表于:2015-10-15 16:41:00
10#
回复 9楼Alice的帖子
  1. <ItemsControl  x:Name="itemsControl" ItemsSource="{Binding CVList}" Grid.ColumnSpan="3" Margin="0,4,0,0" Grid.Row="1">
  2.                     <ItemsControl.Template>
  3.                         <ControlTemplate>
  4.                             <ScrollViewer x:Name="ScrollViewer" Padding="{TemplateBinding Padding}">
  5.                                 <ItemsPresenter />
  6.                             </ScrollViewer>
  7.                         </ControlTemplate>
  8.                     </ItemsControl.Template>
  9.                     <ItemsControl.ItemsPanel>
  10.                         <ItemsPanelTemplate>
  11.                             <WrapPanel Orientation="Horizontal"/>
  12.                         </ItemsPanelTemplate>
  13.                     </ItemsControl.ItemsPanel>
  14.                     <ItemsControl.ItemTemplate>
  15.                         <DataTemplate>
  16.                             <Border Padding="3">
  17.                                 <WrapPanel>
  18.                                     <c1:C1SlideTile Content="C1SlideTile" HorizontalAlignment="Left" Margin="0,0,0,0" ContentSource="{Binding Member}"
  19.                         VerticalAlignment="Top" c1:C1TileService.PointerDownAnimation="True" Width="277" Height="100" Padding="0">
  20.                                         <c1:C1Tile.ContentTemplate>
  21.                                             <DataTemplate>
  22.                                                 <Grid  Width="277" Height="100">
  23.                                                     <Grid.Resources>
  24.                                                         <Style
  25.                 TargetType="Border">
  26.                                                             <Setter
  27.                     Property="BorderBrush"
  28.                     Value="LightGray"></Setter>
  29.                                                             <Setter
  30.                     Property="BorderThickness"
  31.                     Value="1"></Setter>
  32.                                                         </Style>
  33.                                                     </Grid.Resources>
  34.                                                     <Grid.RowDefinitions>
  35.                                                         <RowDefinition Height="27*"/>
  36.                                                         <RowDefinition Height="23*"/>
  37.                                                         <RowDefinition Height="28*"/>
  38.                                                         <RowDefinition Height="22*"/>
  39.                                                     </Grid.RowDefinitions>
  40.                                                     <Grid.ColumnDefinitions>
  41.                                                         <ColumnDefinition Width="26*"/>
  42.                                                         <ColumnDefinition Width="45*"/>
  43.                                                         <ColumnDefinition Width="23*"/>
  44.                                                         <ColumnDefinition Width="8*"/>
  45.                                                         <ColumnDefinition Width="88*"/>
  46.                                                         <ColumnDefinition Width="87*"/>
  47.                                                     </Grid.ColumnDefinitions>
  48.                                                     <Grid.Background>
  49.                                                         <LinearGradientBrush EndPoint="1,0" StartPoint="0.0,0.0">
  50.                                                             <GradientStop Color="White"/>
  51.                                                             <GradientStop Color="Thistle"  Offset="1"/>
  52.                                                         </LinearGradientBrush>
  53.                                                     </Grid.Background>
  54.                                                     <Border  Grid.ColumnSpan="6" Grid.RowSpan="4"/>
  55.                                                     <Label x:Name="bh" Foreground="DimGray"  FontSize="13" FontFamily="微软雅黑" FontWeight="Bold" Height="26" VerticalAlignment="Center" VerticalContentAlignment="Center"
  56.                Margin="8,1,3,0" HorizontalContentAlignment="Center" Opacity="0.5" Grid.Column="2"
  57.                Content="{Binding OrderNo}" Grid.ColumnSpan="3"/>
  58. </Grid>
  59.                                             </DataTemplate>
  60.                                         </c1:C1Tile.ContentTemplate>
  61.                                         <!--<c1:C1Tile.BackContentTemplate>
  62.                                             <DataTemplate></DataTemplate>
  63.                                         </c1:C1Tile.BackContentTemplate>-->
  64.                                     </c1:C1SlideTile>
  65.                                 </WrapPanel>
  66.                             </Border>
  67.                         </DataTemplate>
  68.                     </ItemsControl.ItemTemplate>
  69.                 </ItemsControl>
复制代码


这里的CVList就是一个ObservableCollection<Member>集合,tile的contentsource绑定的是Member,然后里面有个label绑定的是Member的属性OrderNo
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2015-10-15 09:12:00
9#
回复 8楼feiyan0320的帖子

把你修改后的demo发给我们,我们帮你看看。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
feiyan0320
中级会员   /  发表于:2015-10-14 22:47:00
8#
回复 7楼Alice的帖子

我把ObservableCollection集合给了tile的ContentSource,似乎只有一个tile,而且如果集合是一个字符串的话,磁贴上展示的是一个一个字符的滚动。
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2015-10-14 10:04:00
7#
回复 6楼feiyan0320的帖子

根据我的理解,ObservableCollection集合中有多个对象的示例。C1Tile通过ContentSource绑定到这个集合后,就会按照多个对象的实例自动展示出多个磁贴去显示全部,实际的C1Tile的内容就是多个。

还是说我对你的业务场景的理解有偏差?
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
12下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部