windows-phone-7 – 在WP7上将PivotItems数据绑定到ObservableCo
发布时间:2020-12-14 01:52:02 所属栏目:Windows 来源:网络整理
导读:我想将一个ObservableCollection数据绑定到WP7中的Pivot contronl,以便我的ObservableCollection中的每个对象都变成一个PivotItem.这是我使用的代码: controls:Pivot x:Name="MainPivot" ItemsSource="{Binding Persons}" controls:Pivot.HeaderTemplate Da
我想将一个ObservableCollection数据绑定到WP7中的Pivot contronl,以便我的ObservableCollection中的每个对象都变成一个PivotItem.这是我使用的代码:
<controls:Pivot x:Name="MainPivot" ItemsSource="{Binding Persons}"> <controls:Pivot.HeaderTemplate> <DataTemplate> <TextBlock Text="{Binding FullName}"/> </DataTemplate> </controls:Pivot.HeaderTemplate> <controls:Pivot.ItemTemplate> <DataTemplate> <StackPanel Margin="0,17" Width="432"> <TextBlock Text="{Binding FirstName}"/> <TextBlock Text="{Binding LastName}"/> <TextBlock Text="{Binding HomeTown}"/> </StackPanel> </DataTemplate> </controls:Pivot.ItemTemplate> </controls:Pivot> 这适用于我的ObservableCollection中的tre项目,我得到三个PivotItems.但是当一切都被加载时,DataTemplate内部的绑定将不会更新.只有当我滚动到下一个PivotItem时才会加载FirstName,LastName和HomeTown. 这是为什么?我错过了什么? 谢谢 解决方法
看看这个讨论:
DataBound Pivot control is not creating the first PivotItem (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- .内部(La_rs(x,FALSE))在Windows上长时间(可重现)脚本后崩溃
- Win10系统安装UEFI+GPT配置
- 可以在Windows上提供Grand Central Dispatch(`libdispatch`
- windows-phone-8.1 – 提交给Windows Phone Store的错误版本
- exchange-2010 – 如何将用户与内部部署和云邮箱进行协调?
- Windows Phone 7 – API调用,以检查在仿真器wp7中是否运行
- 在Windows上使用Qt Creator的控制台应用程序:在关闭控制台
- 发布管理 – 非R2与R2版本的Microsoft产品[已关闭]
- windows – 现代版的WinDiff?
- 解决win10 蓝牙设备只能配对无法连接 ,并且删除设备无效的
推荐文章
站长推荐
- 如何在Windows 7上远程执行kill-switch?
- 带有标题和项模板列的Windows 8 XAML ListView应
- 使用puppet exec检测是否已安装Windows服务
- windows-server-2008-r2 – 如何使用AD / GPO /打
- windows-7 – WebDAV和Windows 7客户端
- windows – 记录进程加载的DLL
- 在Windows / Active Directory环境中的服务器上配
- windows-server-2008 – Hyper-V:从子网为VM分配
- win10下,MySQL5.5.61重置密码
- windowsServer-------- 系统中调出文件扩展名
热点阅读