private static void UnRegisterBindings(Window window, InputBindingCollection inputBindingCollection) { foreach (var keyBinding in inputBindingCollection.OfType <KeyBinding>()) { window.InputBindings.Remove(keyBinding); } }