olvr_vrmr
olvr_vrmr

Reputation: 113

C# & XAML - TextBox binding not updating content

I have a TextBox in a Stackpanel, as in the code below

<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>

When the Visibility is set to Visible in my converter, my textbox doesn't update it's Text property, even though the Property gets it's correct value (tested by showing a MessageBox with the Property).

Any thoughts?

Upvotes: 0

Views: 1049

Answers (1)

Jodrell
Jodrell

Reputation: 35696

The Time property will need to be either a Dependency Property with the right binding or on a class that Implements the INotifyPropertyChanged Interface, for the Time property, in order for the update to occur "Automatically."

Upvotes: 1

Related Questions