I am trying to understand the constructor parameters of RoutedUICommand
.
- What is the
ownerType
argument for? - Is it a valid solution to just pass
null
ortypeof(object)
asownerType
? - What is the value of
ownerType
, when calling the empty constructor?
My current context is following:
public static class CustomApplicationCommands
{
public static RoutedUICommand SettingsCommand = new RoutedUICommand(
text: "Opens the settings window",
name: nameof(SettingsCommand),
ownerType: typeof(object), // ???
inputGestures: new InputGestureCollection(new InputGesture[] {
new KeyGesture(Key.F10)
})
);
}
Feel free to ask for more information. I will really appreciate your answers. Thank you!