Example #1
0
        static public void Initilize(AvaloniaEngine engine)
        {
            engine.AddSimpleInstancer <ListBox>();
            engine.AddAvaloniaPropertyAttributeLinksForType <ListBox>();
            engine.AddDynamicChildrenInfo <ListBox, ListBoxItem>((b, o) => b.Items = o);

            engine.AddSimpleInstancer <ListBoxItem>();
            engine.AddAvaloniaPropertyAttributeLinksForType <ListBoxItem>();
        }
Example #2
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);
        }
Example #3
0
        static public void Initilize(AvaloniaEngine engine)
        {
            engine.AddAvaloniaPropertyAttributeLinksForType <Panel>();
            engine.AddDynamicChildrenInfo <Panel>(p => p.Children);

            engine.AddSimpleInstancer("HorizontalLayout", () => new StackPanel()
            {
                Orientation = Avalonia.Layout.Orientation.Horizontal
            });
            engine.AddSimpleInstancer("VerticalLayout", () => new StackPanel()
            {
                Orientation = Avalonia.Layout.Orientation.Vertical
            });
            engine.AddAvaloniaPropertyAttributeLinksForType <StackPanel>();

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

            engine.AddLinkInfo <Control, Dock>("dock", DockPanel.DockProperty);

            engine.AddSimpleInstancer <Grid>();
            engine.AddAvaloniaPropertyAttributeLinksForType <Grid>();
            engine.AddLinkInfo <Grid, string>("columns", (g, s) => g.SetColumnsDefinitionString(s), g => g.GetColumnsDefinitionString());
            engine.AddLinkInfo <Grid, string>("rows", (g, s) => g.SetRowsDefinitionString(s), g => g.GetRowsDefinitionString());

            engine.AddDynamicChildrenInfo <Grid>(g => g.Children);

            engine.AddLinkInfo <Control, int>("column", Grid.ColumnProperty);
            engine.AddLinkInfo <Control, int>("row", Grid.RowProperty);

            engine.AddLinkInfo <Control, int>("column_span", Grid.ColumnSpanProperty);
            engine.AddLinkInfo <Control, int>("row_span", Grid.RowSpanProperty);

            engine.AddSimpleInstancer <GridSplitter>();
            engine.AddAvaloniaPropertyAttributeLinksForType <GridSplitter>();
        }
Example #4
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));
        }
Example #5
0
 static public void Initilize(AvaloniaEngine engine)
 {
     engine.AddDynamicChildrenInfo <ItemsControl, object>((c, os) => c.Items = os);
 }