XPlatform .NET UI framework (For best experience access this chat on Telegram https://t.me/Avalonia)
Robert
Thanks, I gave this a shot but it was still preventing the textbox from receiving input when I tried it. In any case I solved it now by making the commands unexecutable when that textbox is active. Not ideal and only works for my situation, but atleast it works around my impedement (re @timunie: Robert I found that I can disable parent key bindings if I place another one inside TextBox like:
<Window.KeyBindings>
<KeyBinding Command="{Binding DoSometingCommand}" Gesture="Ctrl+C"></KeyBinding>
</Window.KeyBindings>
<Design.DataContext>
<vm:MainWindowViewModel/>
</Design.DataContext>
<StackPanel>
<TextBox>
<TextBox.KeyBindings>
<KeyBinding Command="{Binding DoNothingCommand}" Gesture="Ctrl+C"></KeyBinding>
</TextBox.KeyBindings>
</TextBox>
<TextBlock Text="{Binding Count}"></TextBlock>
<Button />
</StackPanel>
my ViewModel:
public partial class MainWindowViewModel : ObservableObject
{
[ObservableProperty]
private int _Count;
[RelayCommand]
void DoSometing() => Count++;
[RelayCommand]
void DoNothing(){}
})
Type
to be indexed also specified - which has really big implications for the inheritance hierarchy of the classes in question.