예제 #1
0
        static public void Initilize(AvaloniaEngine engine)
        {
            engine.AddSimpleInstancer <Window>();
            engine.AddAvaloniaPropertyAttributeLinksForType <Window>();

            engine.AddFunctionInfo <Window>("on_close", (w, s) => w.Closed += s.GetEventHandler());
        }
예제 #2
0
        static public void Initilize(AvaloniaEngine engine)
        {
            engine.AddSimpleInstancer <ScrollViewer>();
            engine.AddAvaloniaPropertyAttributeLinksForType <ScrollViewer>();

            engine.AddSingleDynamicChildInfo <ScrollViewer, Control>((v, c) => v.Content = c);
        }
예제 #3
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);
        }
예제 #4
0
        static public void Initilize(AvaloniaEngine engine)
        {
            engine.AddSimpleInstancer <TabControl>();
            engine.AddAvaloniaPropertyAttributeLinksForType <TabControl>();

            engine.AddSimpleInstancer <TabItem>();
            engine.AddAvaloniaPropertyAttributeLinksForType <TabItem>();
        }
예제 #5
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>();
        }
예제 #6
0
        static public void Initilize(AvaloniaEngine engine)
        {
            engine.AddSimpleInstancer <TextBlock>("Text");
            engine.AddAvaloniaPropertyAttributeLinksForType <TextBlock>();

            engine.AddVariationInstancer <TextBlock>("Label", "Text", t => t.FontSize  = 12.0);
            engine.AddVariationInstancer <TextBlock>("Header", "Text", t => t.FontSize = 22.0);
            engine.AddVariationInstancer <TextBlock>("Title", "Text", t => t.FontSize  = 33.0);

            engine.AddLinkInfo <TextBlock, string>("value", TextBlock.TextProperty);
        }
예제 #7
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);
        }
예제 #8
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);
        }
예제 #9
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));
        }
예제 #10
0
        static public void Initilize(AvaloniaEngine engine)
        {
            engine.AddSimpleInstancer <TextBox>("TextField");
            engine.AddAvaloniaPropertyAttributeLinksForType <TextBox>();

            engine.AddVariationInstancer <TextBox>("SmallField", "TextField", b => {
                b.GotFocus += (s, e) => b.SelectAllText();
            });

            engine.AddVariationInstancer <TextBox>("StringField", "SmallField", b => { });
            engine.AddVariationInstancer <TextBox>("IntField", "SmallField", b => { });
            engine.AddVariationInstancer <TextBox>("FloatField", "SmallField", b => { });

            engine.AddLinkInfo <TextBox, string>("text", TextBox.TextProperty);
            engine.AddLinkInfo <TextBox, string>("value", TextBox.TextProperty);
        }
예제 #11
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(); });
        }
예제 #12
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>();
        }
예제 #13
0
 static public void DoDialog <T>(this Window item, Process <T> process)
 {
     item.ShowDialog <T>(AvaloniaEngine.GetMainWindow())
     .ContinueWith(t => t.Result.IfNotNull(r => process(r)));
 }
예제 #14
0
 static public void Initilize(AvaloniaEngine engine)
 {
     engine.AddSimpleInstancer <Image>();
     engine.AddAvaloniaPropertyAttributeLinksForType <Image>();
 }
예제 #15
0
 static public void DoDialog(this OpenFileDialog item, Process <string[]> process)
 {
     item.ShowAsync(AvaloniaEngine.GetMainWindow())
     .ContinueWith(t => t.Result.IfNotNull(r => process(r)));
 }
예제 #16
0
 static public void Initilize(AvaloniaEngine engine)
 {
     engine.AddDynamicChildrenInfo <ItemsControl, object>((c, os) => c.Items = os);
 }
예제 #17
0
 static public void Initilize(AvaloniaEngine engine)
 {
 }
예제 #18
0
 static public void Initilize(AvaloniaEngine engine)
 {
     engine.AddSingleDynamicChildInfo <ContentControl, Control>((cc, c) => cc.Content = c);
 }
예제 #19
0
 static public void Initilize(AvaloniaEngine engine)
 {
     engine.AddSingleDynamicChildInfo <Decorator, Control>((d, c) => d.Child          = c);
     engine.AddSingleDynamicChildInfo <Decorator, Control>("child", (d, c) => d.Child = c);
 }