1

I've created a custom text box style:

<Style x:Key="CustomTextBox" TargetType="{x:Type TextBox}" >
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type TextBox}">
                <Grid>
                    <TextBox Text="{TemplateBinding Text}" />
                </Grid>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

I've used it like:

<TextBox Text="{Binding UserName}" Style="{DynamicResource CustomTextBox}"/>

And I can only get value of UserName inside the TextBox when I run the app, but when I try to change it in this TextBox - nothing happens, nothing triggers no matter of what I'm doing. And UserName remains the same. [DataContext is set properly]

I don't understand that part of concept, I need to have UserName changed by changing 'Text' inside this TextBox. What is wrong with my code? Help would be appreciated, thanks.

Oleg T.
  • 21
  • 5

0 Answers0