当前位置:编程学习 > wap >>

wp神级困惑,大师们进来看看啊

拿到一个别人开发的wp程序,运行起来,在这里就报错
  public MainPage()
        {
            try
            {
                InitializeComponent();
            }
            catch (Exception ex)
            {
            }
        }
错误信息:
{System.Windows.Markup.XamlParseException:  [Line: 0 Position: 0] ---> System.Windows.Markup.XamlParseException: The type 'TemplatedListBox' was not found. [Line: 446 Position: 61]
   at MS.Internal.XcpImports.CreateFromXaml(UnmanagedMemoryStream stream, String sourceAssemblyName, Boolean createNamescope, Boolean requireDefaultNamespace, Boolean allowEventHandlers, String xamlResourceUriString)
   at System.Windows.Controls.Control.LoadXamlResource(Assembly source, String streamName, CultureInfo cultureInfo)
   --- End of inner exception stack trace ---
   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   at AutoWP7.MainPage.InitializeComponent()
   at AutoWP7.MainPage..ctor()}

查了一下午,也没找到有人遇到同类问题
大神请注意,The type 'TemplatedListBox' was not found. [Line: 446 Position: 61] 这句话,TemplatedListBox这个东西我整个项目里也没有。Line: 446 Position: 61位置提示显然也不具有任何参考性!
坐等高手指点 Windows Phone 异常 wp8 移动开发 --------------------编程问答-------------------- 1,InitializeComponent();这句不用try...
2,你看一下你的xaml文件里搜一下有没有TemplatedListBox --------------------编程问答-------------------- 推测是你的listbox里面设置了一个template=“{staticresource TemplatedListBox}”,然后资源字典里又没有添加这个资源 --------------------编程问答--------------------
引用 2 楼 lixygibli 的回复:
推测是你的listbox里面设置了一个template=“{staticresource TemplatedListBox}”,然后资源字典里又没有添加这个资源

++
补充:移动开发 ,  Windows Phone
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,