static public void Initilize(AvaloniaEngine engine) { engine.AddSimpleInstancer <Window>(); engine.AddAvaloniaPropertyAttributeLinksForType <Window>(); engine.AddFunctionInfo <Window>("on_close", (w, s) => w.Closed += s.GetEventHandler()); }
static public void Initilize(AvaloniaEngine engine) { engine.AddSimpleInstancer <ScrollViewer>(); engine.AddAvaloniaPropertyAttributeLinksForType <ScrollViewer>(); engine.AddSingleDynamicChildInfo <ScrollViewer, Control>((v, c) => v.Content = c); }
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 <TabControl>(); engine.AddAvaloniaPropertyAttributeLinksForType <TabControl>(); engine.AddSimpleInstancer <TabItem>(); engine.AddAvaloniaPropertyAttributeLinksForType <TabItem>(); }
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>(); }
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.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); }
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); }
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 <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 <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(); }); }
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>(); }
static public void DoDialog <T>(this Window item, Process <T> process) { item.ShowDialog <T>(AvaloniaEngine.GetMainWindow()) .ContinueWith(t => t.Result.IfNotNull(r => process(r))); }
static public void Initilize(AvaloniaEngine engine) { engine.AddSimpleInstancer <Image>(); engine.AddAvaloniaPropertyAttributeLinksForType <Image>(); }
static public void DoDialog(this OpenFileDialog item, Process <string[]> process) { item.ShowAsync(AvaloniaEngine.GetMainWindow()) .ContinueWith(t => t.Result.IfNotNull(r => process(r))); }
static public void Initilize(AvaloniaEngine engine) { engine.AddDynamicChildrenInfo <ItemsControl, object>((c, os) => c.Items = os); }
static public void Initilize(AvaloniaEngine engine) { }
static public void Initilize(AvaloniaEngine engine) { engine.AddSingleDynamicChildInfo <ContentControl, Control>((cc, c) => cc.Content = c); }
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); }