模板中的进度栏​​错误,也许 [英] Progress Bar error in templete, maybe

查看:81
本文介绍了模板中的进度栏​​错误,也许的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将WPF与黑暗神庙"表情一起使用,并遇到了跟踪错误.我已跟踪到对绑定数据源进行更新的时间.该邮件昨晚一直在工作,今天停了下来,不知道我为阻止它工作或如何进行修复怎么做.转换器通常返回12,所以我不认为这是量程错误.
错误:
PresentationFramework.dll中发生类型为'System.InvalidOperationException'的第一次机会异常
在'System.Windows.Controls.ControlTemplate'的名称范围中找不到'PART_Track'名称'.

XAML:

I am using WPF with the Expression Dark templete and am getting the follow error.  I have tracked it down to when a update is done to the a bound data source.  It was working last night this morning and stopped, no clue what I did to stop it from working or how to fix it.  The converter is return 12 normally so I don't think it is a range error.

Anybody have a suggestion on where to look or what to look for or how to look for it?

Error:
A first chance exception of type 'System.InvalidOperationException' occurred in PresentationFramework.dll
'PART_Track' name cannot be found in the name scope of 'System.Windows.Controls.ControlTemplate'.

XAML:

<ProgressBar Orientation="Vertical"

             Width="15"

             Value="{Binding Path=Strength, Mode=OneWay, NotifyOnTargetUpdated=True, Converter={StaticResource csqConverter}}"

             Maximum="100"

             Minimum="0"

             Background="White"

             Foreground="Black"

             HorizontalAlignment="Right"></ProgressBar>

转换器:

Converter:

public object Convert(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)

{

    if (value is int)

    {

        int i = (int)value;

        if (i >= 1 && i <= 100)

        {

            return i;

        }



        return 0;

    }



    return value;

}

Regards,
John J. Hughes II
http://www.functioninternational.com/

推荐答案

约翰,
我有同样的问题.我的情况是我使用的是tabcontrol.而且进度条可能在任何选项卡上,所以当更新不在活动选项卡上的进度条值时会抛出此错误,但是当它处于打开状态时活动选项卡运行良好.
        I have the same problem.In my case i am using tabcontrol.And my progressbar may be on any of tabs.So when a progressbar value which is not on active tab is updated it throws this error.But when it is on active tab it functions well.


这篇关于模板中的进度栏​​错误,也许的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆