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); }
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)); }
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); }
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); }
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>(); }