Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#&;XAML-文本框绑定不更新内容_C#_Wpf_Binding - Fatal编程技术网

C#&;XAML-文本框绑定不更新内容

C#&;XAML-文本框绑定不更新内容,c#,wpf,binding,C#,Wpf,Binding,我在Stackpanel中有一个文本框,如下代码所示 <StackPanel x:Name="EtenStack" Visibility="{Binding Path=Sort, ConverterParameter=Eten, Converter={StaticResource convertEten}}"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">

我在Stackpanel中有一个文本框,如下代码所示

<StackPanel x:Name="EtenStack" Visibility="{Binding Path=Sort, ConverterParameter=Eten, Converter={StaticResource convertEten}}">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                <Label Content="Bereidingstijd"/>
                <TextBox Height="23" Width="150" Text="{Binding Path=Time, TargetNullValue='', Mode=TwoWay}"/>
            </StackPanel>

在我的转换器中将可见性设置为Visible时,我的textbox不会更新它的Text属性,即使该属性获得了正确的值(通过显示带有该属性的MessageBox进行测试)


有什么想法吗?

对于
时间
属性,
时间
属性需要是具有正确绑定的依赖属性,或者在实现
INotifyPropertyChanged
接口的类上,才能“自动”进行更新

您是否调用notifypropertychanged事件以使其可见?时间是一个依赖属性,我将其更改为常规属性,并实现了INotifyPropertyChanged和hurrah,它成功了!谢谢@Jodrell