Binding to the text property with UpdateSourceTrigger=PropertyChanged doesn't work
See original GitHub issueSo one solution would be to change the xaml to
<TextBox x:Name="PART_Editor"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Style="{StaticResource ResourceKey=TransparentTextBoxStyle}"
Text="{Binding Path=Text, RelativeSource={RelativeSource Mode=TemplatedParent}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
This would have a very minor performance hit, however clearly no one is relying on this property currently. I would like if it could somehow automatically use the right one or be a user preference. I think we could do the user preference by adding another parameter on the AutoCompleteTextBox of “UpdateTextExplicitly” and then manually establish the binding in code behind rather than in xaml.
I figured open an issue for discussion.
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (10 by maintainers)
Top Results From Across the Web
UpdateSourceTrigger not working?
This example seems to work fine: Code: public partial class MainWindow : Window, INotifyPropertyChanged { public MainWindow() ...
Read more >The UpdateSourceTrigger property
This behavior is controlled by a property on the binding called UpdateSourceTrigger. It defaults to the value "Default", which basically means that the...
Read more >INotifyPropertyChanged doesnt work when updating data ...
The problem is that you have not specific current DataContext when used Binding , For solving this problem you could specific current ...
Read more >“Propertychange” is not firing up when text is changed or ...
The issue is even when my ViewModel is implementing Inotification Changed interface and the property is bound tot the text property of the ......
Read more >UpdateSourceTrigger=PropertyChanged Doesn't Work On ...
If you have an editor control (DoubleEditBox, Int32EditBox) that uses a DataBinding for it's value, with UpdateSourceTrigger=PropertyChanged ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Go on with option 2, so user can choice what is better… Agree?
On Nov 26, 2017 19:23, “Mitch Capper” notifications@github.com wrote:
<TextBox x:Name="PART_Editor" HorizontalAlignment="Stretch" VerticalAlignment="Center" Style="{StaticResource ResourceKey=TransparentTextBoxStyle}" Text="{Binding Path=Text, RelativeSource={RelativeSource Mode=TemplatedParent}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
I suspect the problem is that
Text="{Binding Path=Text, ...
is trying to bindTextBox.Text
to a property in your ViewModel, instead of theAutoCompleteTexBox.Text
, it was the case for me in a different solution. It is worth to check. If not, another problem is that if inside AutoCompleteTexBox.cs you assign values direct toTextBox.Text
by doing something like_tb.Text = "something"
, it won’t work. What I did was usethis.Text = "something"
instead.