I have a textbox and I have binded ctrl key for it. Suppose a user has typed the below sentence in the textbox.
"I love my Country "
And the current cursor positin is inside the word "Country". Now the users just pressed the control(ctrl) key and then I want that the current word under the cursor position that means "Country" will be passed to my view Model.
<TextBox x:Name="textBox" Width="300" Text="{Binding SomeText, UpdateSourceTrigger=PropertyChanged}">
<TextBox.InputBindings>
<KeyBinding Key="LeftCtrl" Command="{Binding LeftCtrlKeyPressed, Mode=TwoWay}" CommandParameter="" />
</TextBox.InputBindings>
</TextBox>
Is there any way to pass that current word through command parameter.
CommandParameter
doesn't allow dependency properties. – Herdo