A
A
Andrey2016-09-29 06:15:57
WPF
Andrey, 2016-09-29 06:15:57

How to make it so that when the TextBox changes, the object is immediately drawn?

We have: XAML

<TextBox  Height="23" Name="TBLength" Width="60" Text="{Binding Path=L, Mode=TwoWay, 
UpdateSourceTrigger=PropertyChanged}" TextChanged="Beam1_isChanged" />

A property is bound to the TextBox:
public double L 
    {
        get { return (double)GetValue(LProperty); }
        set 
        {  SetValue(LProperty, value); }
    }
    public static readonly DependencyProperty LProperty = 
DependencyProperty.Register("L", typeof(double), typeof(Beam),
        new FrameworkPropertyMetadata());

And the event TextChanged="Beam1_isChanged" is signed,
the Beam1_isChanged method should draw, but when the value in the textbox changes, the method is launched with the old parameters, i.e. property has not been updated. What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2016-09-29
@ander822

Everything worked after a reboot. It doesn't seem to be in the code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question