How can I write template look like this?
<DataTemplate ... TextBlock>
UpdateSourceTrigger=PropertyChanged
</DataTemplate>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You cannot change the default mode for the
UpdateSourceTriggerin a style. This is configured as theDefaultUpdateSourceTriggerof theFrameworkPropertyMetadataclass when theDependencyProperty(in this case theTextproperty) is registered.You could either create a custom text box type which derives from
TextBoxand changes this value when registering the dependency property. Alternatively, you might want to look into the Caliburn.Micro MVVM framework, which automatically sets this for all text boxes in an app (via code, as part of its convention based binding).