Exemple #1
0
        static public void Initilize(AvaloniaEngine engine)
        {
            engine.AddAvaloniaPropertyAttributeLinksForType <Control>();
            engine.AddGeneralModifier <Control>((ex, c) => c.DataContext = ex.GetTargetInfo().GetTarget());

            engine.AddValueInfo <Control, bool>("auto_focus", (c, v) => v.IfTrue(() => c.Focus()));

            engine.AddFunctionInfo <Control>("on_mouse_down", Control.PointerPressedEvent);
            engine.AddFunctionInfo <Control>("on_mouse_up", Control.PointerReleasedEvent);
            engine.AddFunctionInfo <Control>("on_mouse_move", Control.PointerMovedEvent);

            engine.AddFunctionInfo <Control>("on_click", Control.TappedEvent);
            engine.AddFunctionInfo <Control>("on_double_click", Control.DoubleTappedEvent);
        }
Exemple #2
0
        static public void Initilize(AvaloniaEngine engine)
        {
            engine.AddSimpleInstancer <Window>();
            engine.AddAvaloniaPropertyAttributeLinksForType <Window>();

            engine.AddFunctionInfo <Window>("on_close", (w, s) => w.Closed += s.GetEventHandler());
        }
Exemple #3
0
        static public void Initilize(AvaloniaEngine engine)
        {
            engine.AddSimpleInstancer <DragHandler_Internal_Value>("DragHandler");
            engine.AddLinkInfo <DragHandler_Internal_Value, object>("value", (h, v) => h.SetValue(v), h => h.GetValue(), h => true);
            engine.AddLinkInfo <DragHandler, DragDropEffects>("drag_drop_effects", (h, e) => h.SetDragDropEffects(e), e => e.GetDragDropEffects(), h => true);

            engine.AddLinkInfo <Control, DragHandler>("drag_handler", (e, h) => e.SetDragHandler(h), e => e.GetDragHandler());

            engine.AddSimpleInstancer <DropHandler_Internal_FunctionSyncro>("DropHandler");
            engine.AddFunctionInfo <DropHandler_Internal_FunctionSyncro>("on_enter", (h, f) => h.SetOnEnter(f));
            engine.AddFunctionInfo <DropHandler_Internal_FunctionSyncro>("on_over", (h, f) => h.SetOnOver(f));
            engine.AddFunctionInfo <DropHandler_Internal_FunctionSyncro>("on_leave", (h, f) => h.SetOnLeave(f));
            engine.AddFunctionInfo <DropHandler_Internal_FunctionSyncro>("on_drop", (h, f) => h.SetOnDrop(f));

            engine.AddDynamicChildrenInfo <Control, DropHandler>("drop_handlers", (c, h) => c.SetDropHandlers(h));
        }
Exemple #4
0
        static public void Initilize(AvaloniaEngine engine)
        {
            engine.AddSimpleInstancer <Button>();
            engine.AddAvaloniaPropertyAttributeLinksForType <Button>();

            engine.AddLinkInfo <Button, string>("text", Button.ContentProperty);
            engine.AddFunctionInfo <Button>("action", Button.ClickEvent);
        }
Exemple #5
0
        static public void Initilize(AvaloniaEngine engine)
        {
            engine.AddSimpleInstancer <ContextMenu>();
            engine.AddAvaloniaPropertyAttributeLinksForType <ContextMenu>();

            engine.AddSimpleInstancer <Menu>();
            engine.AddAvaloniaPropertyAttributeLinksForType <Menu>();

            engine.AddSimpleInstancer <MenuItem>();
            engine.AddAvaloniaPropertyAttributeLinksForType <MenuItem>();
            engine.AddFunctionInfo <MenuItem>("command", (i, s) => i.Command = s.GetCommand());
            engine.AddFunctionInfo <MenuItem>("action", MenuItem.ClickEvent);

            engine.AddSimpleInstancer <Separator>();
            engine.AddAvaloniaPropertyAttributeLinksForType <Separator>();

            engine.AddValueInfo <Control, ContextMenu>("context_menu", (f, e) => { f.ContextMenu = e; f.InvalidateVisual(); });
        }
Exemple #6
0
        static public void Initilize(AvaloniaEngine engine)
        {
            engine.AddSimpleInstancer <KeyBinding>();
            engine.AddAvaloniaPropertyAttributeLinksForType <KeyBinding>();
            engine.AddFunctionInfo <KeyBinding>("action", (b, s) => b.Command = s.GetCommand());

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

            engine.AddDynamicChildrenInfo <Control>("key_bindings", e => e.KeyBindings);
        }