- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在数据绑定(bind)期间遇到奇怪的未处理异常。我正在将 ListBox 与 IList 进行数据绑定(bind)。用对象填充列表后,我将 ListBox 的 DataContext 设置为我的对象:
IList<Users> users = new List<Users>;
foreach(JToken jresult in Users)
{
User juser = JsonConvert.DeserializeObject<User>(jresult.ToString());
users.Add(juser);
this.DataContext = myObject;
我的对象只有两个字段,名称和电子邮件:
public class User
{
public string name { get; set; }
public string email { get; set; } }
在 XAML 方面,我将 ListItem 和 ItemTemplate 中的文本 block 绑定(bind)在一起,如下所示:
<ListBox Name="Users" ItemsSource="{Binding}">
<TextBlock Text="{Binding Name}" Name="name" />
<TextBlock Text="{Binding Email}" Name="email" />
在调试期间,我可以看到“用户”列表框填充了正确的项目,但是退出该方法后,应用程序崩溃,并且我直接进入 App.xaml.cs 方法 Application_UnhandledException。错误详细信息是:
e.ExceptionObject.InnerException
{"0x8000ffff"}
_data: null
_HResult: -2146233088
_innerException: null
_message: "0x8000ffff"
_methodDescs: {System.IntPtr[14]}
_optionalData: null
Data: {System.Collections.ListDictionaryInternal}
HResult: -2146233088
InnerException: Could not evaluate expression
Message: "0x8000ffff"
StackTrace: " at MS.Internal.XcpImports.CheckHResult(UInt32 hr)\r\n at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)\r\n at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)\r\n at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)\r\n at MS.Internal.XcpImports.MeasureNative(IntPtr element, Single inWidth, Single inHeight)\r\n at MS.Internal.XcpImports.UIElement_Measure(UIElement element, Size availableSize)\r\n at System.Windows.UIElement.Measure(Size availableSize)\r\n at System.Windows.Controls.VirtualizingStackPanel.MeasureChild(UIElement child, Size layoutSlotSize)\r\n at System.Windows.Controls.VirtualizingStackPanel.MeasureOverride(Size constraint)\r\n at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)\r\n at MS.Internal.XcpImpor
ts.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)\r\n at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)\r\n at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)\r\n at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)\r\n"
我无法弄清楚这一点,并且非常感谢任何指导,或者可能是解决此类问题的更好方法。一篇文章确实提到 SilverLight 不再支持 ListDictionaryInternal,因此我不确定这是否是问题所在,因为错误详细信息指向 ListDictionaryInternal。
最佳答案
想听一些奇怪的事情。我遇到了这个问题,并在 XAML 中删除了 style="{StaticResource ....} 并修复了它。有人可以解释为什么吗?之后我添加了一个本地 StaticResource,它也起作用了。
如果您的列表框项目中的任何位置都没有设置样式,则此解决方案将无济于事。
关于data-binding - wp7 数据绑定(bind)上出现奇怪的 UnhandledException 0x8000ffff,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5028575/
我正在尝试在我正在处理的博客上使用类别帖子 (WP-CPL) 插件来按类别过滤“最近的帖子”。基本上,当有人点击博客上的类别名称时,我希望它显示该类别的帖子。这将通过 Life Is Simple 模
我的形象 我只想为某些用户隐藏特定页面。 function remove_menus(){ // get current login user's role $roles = wp_g
我的形象 我只想为某些用户隐藏特定页面。 function remove_menus(){ // get current login user's role $roles = wp_g
我为我的 wp 网站创建了一个简单的脚本,我正在尝试从 2 个表的 wp 数据库中获取正确的数据,这是代码, 当我显示“user_ref_id”列的结果重复多次时,这是代码 global $wpdb;
我安装了一个名为 Hide My WP 的插件来更改网站结构,但考虑到我使用的是自定义主题,它破坏了一些功能。所以我手动从plugins文件夹中删除了插件,但是从那以后我就无法访问/wp-admin/
我试图从头开始创建 WXR 文件(WordPress eXtended Rss)。 我的代码基于 XML/ wordpress生成的WXR文件并像这样开始: 我是这样开始的: $newxml =
我想将所有页面重定向到 http://www.expample2.com除了 wp-admin 和 wp-json。 例如,用户能够登录 http://www.example1.com/wp-admi
我使用 MAMP 在本地构建了一个快速的 WordPress 网站,然后将其 checkin SVN 存储库。然后我将其检查到我的开发服务器上。 除了运行 search and replace too
在搜索端点的 WP REST API (wp json) 中: https://www.example.com/wp-json/wp/v2/search?search=searchPhrase&_em
我正在使用这个 NGINX 规则来强制 WordPress 网站的尾部斜杠: rewrite ^([^.]*[^/])$ $1/ permanent; 但是这个规则给 Gutenberg 和 wp-j
在搜索端点的 WP REST API (wp json) 中: https://www.example.com/wp-json/wp/v2/search?search=searchPhrase&_em
我正在使用这个 NGINX 规则来强制 WordPress 网站的尾部斜杠: rewrite ^([^.]*[^/])$ $1/ permanent; 但是这个规则给 Gutenberg 和 wp-j
我想限制所有用户访问 WordPress 网站登录。 例如:假设我有 WordPress 网站域 example1.com,我想限制所有用户使用 example1.com/wp- 访问管理员登录adm
尝试实现这里讨论的技术, http://z9.io/2013/10/21/shiny-new-dynamic-content-wp-super-cache/ 进入使用 Genesis 框架的站点。我想
我试图在位于我的 WP 主题文件夹内的 PHP 文件中调用自定义 AJAX 函数,但是我无法让它检索输出。我认为问题在于将 WP 查询链接到主 WP 文件? $.ajax({ url: "../../
我正在编写一个 perl 脚本,用于将 Wordpress 安装从一个地方迁移到另一个地方。在这项工作中,我需要使用 wp-cli 调用从 wp-config 文件中获取 wordpress 数据库名
我最近更改了我的 WordPress 网站上的目录。我导出了数据库,搜索并替换了旧 URL 为新 URL,然后重新导入。该网站的前端工作正常,但任何页面的后端都需要近 15 秒才能加载。 从funct
我使用下面的代码通过类似的单词标签获取帖子但不起作用 $query = " SELECT * FROM $wpdb->posts , $wpdb->terms
我已经通过 DirectAdmin 在我的服务器上安装了 SSL 证书。这似乎运作良好。 我已将 wp_*_options 表中的 url 更改为 https://mydomain.nl 等。突然我的
我正在建立一个网站,使用 wordpress+buddypress(最新版本)。 在这个网站中,我有自己的自定义登录|注册|重置密码表单,我不想将它们链接到后端 wp-forms。 我已经阻止了所有用
我是一名优秀的程序员,十分优秀!