Все, я вижу ниже. Предупреждения в окне "Выход". Может кто-нибудь, пожалуйста, объясните, в чем проблема с Binding здесь. Я установил несколько значений для ProgressValue 'в моей ViewModel. Но для "ProgressValue" установлено только конечное значение 100, как показано ниже.
System.Windows.Data Warning: 95 : BindingExpression (hash=58496944): Got PropertyChanged event from ExportControls (hash=6385044)
System.Windows.Data Warning: 95 : BindingExpression (hash=58496944): Got PropertyChanged event from ExportControls (hash=6385044)
System.Windows.Data Warning: 95 : BindingExpression (hash=58496944): Got PropertyChanged event from ExportControls (hash=6385044)
System.Windows.Data Warning: 95 : BindingExpression (hash=58496944): Got PropertyChanged event from ExportControls (hash=6385044)
System.Windows.Data Warning: 95 : BindingExpression (hash=58496944): Got PropertyChanged event from ExportControls (hash=6385044)
System.Windows.Data Warning: 95 : BindingExpression (hash=58496944): Got PropertyChanged event from ExportControls (hash=6385044)
System.Windows.Data Warning: 95 : BindingExpression (hash=58496944): Got PropertyChanged event from ExportControls (hash=6385044)
System.Windows.Data Warning: 95 : BindingExpression (hash=58496944): Got PropertyChanged event from ExportControls (hash=6385044)
System.Windows.Data Warning: 95 : BindingExpression (hash=58496944): Got PropertyChanged event from ExportControls (hash=6385044)
System.Windows.Data Warning: 95 : BindingExpression (hash=58496944): Got PropertyChanged event from ExportControls (hash=6385044)
System.Windows.Data Warning: 95 : BindingExpression (hash=58496944): Got PropertyChanged event from ExportControls (hash=6385044)
System.Windows.Data Warning: 95 : BindingExpression (hash=58496944): Got PropertyChanged event from ExportControls (hash=6385044)
System.Windows.Data Warning: 95 : BindingExpression (hash=58496944): Got PropertyChanged event from ExportControls (hash=6385044)
System.Windows.Data Warning: 95 : BindingExpression (hash=58496944): Got PropertyChanged event from ExportControls (hash=6385044)
System.Windows.Data Warning: 95 : BindingExpression (hash=58496944): Got PropertyChanged event from ExportControls (hash=6385044)
System.Windows.Data Warning: 95 : BindingExpression (hash=58496944): Got PropertyChanged event from ExportControls (hash=6385044)
System.Windows.Data Warning: 95 : BindingExpression (hash=58496944): Got PropertyChanged event from ExportControls (hash=6385044)
System.Windows.Data Warning: 95 : BindingExpression (hash=58496944): Got PropertyChanged event from ExportControls (hash=6385044)
System.Windows.Data Warning: 95 : BindingExpression (hash=58496944): Got PropertyChanged event from ExportControls (hash=6385044)
System.Windows.Data Warning: 95 : BindingExpression (hash=58496944): Got PropertyChanged event from ExportControls (hash=6385044)
System.Windows.Data Warning: 101 : BindingExpression (hash=58496944): GetValue at level 0 from ExportControls (hash=6385044) using RuntimePropertyInfo(ProgressValue): '100'
System.Windows.Data Warning: 80 : BindingExpression (hash=58496944): TransferValue - got raw value '100'
System.Windows.Data Warning: 89 : BindingExpression (hash=58496944): TransferValue - using final value '100'
Мой код показан ниже. Он определен в Styles.xaml.
<ProgressBar IsIndeterminate="False"
Value="{Binding ProgressValue,
UpdateSourceTrigger=PropertyChanged,
Mode=TwoWay,
diag:PresentationTraceSources.TraceLevel=High}"
x:Name="ExportProgressBar"
Visibility="Collapsed"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
Background="Transparent"
BorderThickness="0"
Foreground="{StaticResource HighlightBlueBrush}"
/>
В моей модели просмотра я обновляю значение, как показано ниже.
Dispatcher.CurrentDispatcher.Invoke(new Action(() =>
{
export.ProgressValue = pMeter;
}));
BradleyDotNET прав.
У вас есть PresentationTraceSources.TraceLevel установлен на Высокий. Это приведет к печати информации о привязке.
type
pMeter?