Ejemplo n.º 1
0
        static public void Initilize(WPFEngine engine)
        {
            engine.AddAttributeChildren <UIElement>("input_bindings", e => e.InputBindings);

            engine.AddSimpleInstancer("InputBinding", () => new InputBinding(EmptyCommand.INSTANCE, EmptyInputGesture.INSTANCE));

            engine.AddAttributeFunction <InputBinding>("action", (b, a) => b.Command = a.GetCommand());
            engine.AddAttributeLink <InputBinding>("gesture", "Gesture");

            engine.AddSimpleConstructor <MouseGesture, string, string>("MouseGesture",
                                                                       (a, m) => new MouseGesture(a.ConvertEX <MouseAction>(), m.ConvertEX <ModifierKeys>())
                                                                       );

            engine.AddSimpleConstructor <KeyGesture, string, string>("KeyGesture",
                                                                     (k, m) => new KeyGesture(k.ConvertEX <Key>(), m.ConvertEX <ModifierKeys>())
                                                                     );
        }