We are using MVVM and want nothing in the View's C# file. We have a designer on staff, and don't want to teach them how to write C#.
We have a Textbox that has text inside of it. It seems necessary to have the OnTextChangedEvent be inside of our VM. (We are binding the text to a string in the VM but it isn't doing everything that we need it to do).
Basically we'd like to take this code and get rid of the codebehind by binding to the OnTextChangedCommand (or something) in our VM:
This is what we have:
<TextBox
x:Name="MyTextBox"
Text="{Binding Path=SomeVariable, Mode=TwoWay}"/>
And in the c# code-behind
MyTextBox.TextChanged += vm.OnTextChanged;
This is what we want:
<TextBox
x:Name="MyTextBox"
Text="{Binding Path=SomeVariable, Mode=TwoWay}"
TextChanged="{Binding OnTextChanged}"/>
and nothing in the c# code-behind