S
S
sergeyfk2017-11-04 19:05:13
WPF
sergeyfk, 2017-11-04 19:05:13

Why does the binding not want to work in this case?

Here is the xml:

<TextBlock FontSize="{Binding TreeViewTextSize}" Text="{Binding Title}" Margin="0 0 10 4"/>

In general, I set the value of TreeViewTextSize in the text field, it changes (checked), but it does not change in the font size of the text block, but if you put the number manually, then everything will change safely.
What is the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Peter, 2017-11-04
@petermzg

1. The TreeViewTextSize property must be of type Double
2. When it changes, the view needs to be informed about it, i.e. implement the INotifyPropertyChanged interface and call PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("TreeViewTextSize"));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question