当我用列表视图中的项目捕捉时,我的应用程序崩溃了

问题描述:

因此,我目前正在针对Windows 8应用商店使用C#/XAML进行项目开发,而我遇到了问题.

So, im currently working on a project using C#/XAML for a Windows 8 Store App and I've encountred a problem.

当用户导航到页面时,将显示带有某些控件的ListView. 然后,当用户决定捕捉页面时,我的应用程序崩溃并显示以下内容:

When the user navigates to a Page a ListView with some Controls shows up. Then when the user decides to snap the page my application crashes and shows this:

这在我的IntelliTrace中显示,然后按异常.

In my IntelliTrace this shows up and I press an Exception.

它会将我导航到此代码.

It navigates me to this code.

     /// <summary>
    /// Implement this partial method to configure the service endpoint.
    /// </summary>
    /// <param name="serviceEndpoint">The endpoint to configure</param>
    /// <param name="clientCredentials">The client credentials</param>

    static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials);

    public EmployeeAssisterClient() : 
            base(EmployeeAssisterClient.GetDefaultBinding(), EmployeeAssisterClient.GetDefaultEndpointAddress()) {
        this.Endpoint.Name = EndpointConfiguration.TimeLoggerEndPoint.ToString();
        ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
    }

我将控件添加到列表视图中,如下所示:

I add the controls to the listview as follows:

            _timeReports = _timeReportDatabase.GetAll();

            foreach (var timeReport in _timeReports)
            {
                _invoicedControls.Add(new InvoicedControl(timeReport)
                    {
                        Customer = timeReport.CustomerName,
                        Date = timeReport.Date,
                        WorkedTime = timeReport.WorkedTime.ToString(),
                        InvoicedTime = timeReport.InvoicedTime.ToString()
                    });
            }

            TimeReportsListViewFillView.ItemsSource = _invoicedControls;
            TimeReportsListViewFullView.ItemsSource = _invoicedControls;
            TimeReportsListViewPortraitView.ItemsSource = _invoicedControls;
            TimeReportsListViewSnappedView.ItemsSource = _invoicedControls;

EDIT =============================================== ===============================

EDIT==============================================================================

这是引发错误的错误

我通过在Cmd中键入"C:\ Program Files \ Microsoft Visual Studio 11.0 \ Common7 \ IDE \ VsDiag_regwcf.exe -u"来关闭WCF调试,并解决了2/3个问题

I turned off WCF debugging by typing "C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\VsDiag_regwcf.exe -u" into the Cmd and it resolved 2/3 problems

这是我的IntelliTrace中的最后一个错误:

This is the last error in my IntelliTrace:

此错误是什么意思?并且any1有解决此问题的想法吗?

What does this error mean? And does any1 have an idea how to fix this?

根据显示的内容,可能是您使用了生成的页面(从模板),然后删除了其中的一些Xaml ,这很好.

Based on what you've shown, it's likely that you've used a generated page (from a template), then removed some of the Xaml inside of it, which is fine.

您可能尚未做的事情是删除对您从VisualStateManager的情节提要中删除的那些控件的引用,特别是针对Snapped状态.

The thing that you likely haven't done is removed the references to those controls you removed from the storyboards of the VisualStateManager, specifically for the Snapped state.

转到页面并检查(通常在底部)Xaml的快照" VisualState,然后检查并查看任何情节提要中是否有不再具有的控件的TargetName.

Go to your page and check (generally at the bottom of) the Xaml for the "Snapped" VisualState, then check and see if any of the Storyboards have a TargetName of a control that you no longer have.