static public void Initilize(WPFEngine engine) { engine.AddSimpleInstancer <TextBlock>("Text"); 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.AddAttributeLink <TextBlock, string>("text", TextBlock.TextProperty); engine.AddAttributeLink <TextBlock, string>("value", TextBlock.TextProperty); }
static public void Initilize(WPFEngine engine) { engine.AddSimpleInstancer <Button>(); engine.AddAttributeLink <Button, string>("text", Button.ContentProperty); engine.AddAttributeFunction <Button>("action", (b, a) => b.Click += a.GetRoutedEventHandler()); engine.AddAttributeFunction <Button>("preview_mouse_left_button_down", (b, a) => b.PreviewMouseLeftButtonDown += a.GetMouseButtonEventHandler()); }
static public void Initilize(WPFEngine engine) { engine.AddSimpleInstancer <TextBox>("TextField"); engine.AddVariationInstancer <TextBox>("SmallField", "TextField", b => { b.GotFocus += (s, e) => b.SelectAll(); b.GotKeyboardFocus += (s, e) => b.SelectAll(); b.GotMouseCapture += (s, e) => b.SelectAll(); }); engine.AddVariationInstancer <TextBox>("StringField", "SmallField", b => { }); engine.AddVariationInstancer <TextBox>("IntField", "SmallField", b => { }); engine.AddVariationInstancer <TextBox>("FloatField", "SmallField", b => { }); engine.AddAttributeLink <TextBox, string>("text", TextBox.TextProperty); engine.AddAttributeLink <TextBox, string>("value", TextBox.TextProperty); }
static public void Initilize(WPFEngine engine) { engine.AddSimpleInstancer <DragHandler_Internal_Value>("DragHandler"); engine.AddAttributeLink <DragHandler_Internal_Value, object>("value", (h, v) => h.SetValue(v), h => h.GetValue(), h => true); engine.AddAttributeLink <DragHandler, DragDropEffects>("drag_drop_effects", (h, e) => h.SetDragDropEffects(e), e => e.GetDragDropEffects(), h => true); engine.AddAttributeLink <UIElement, DragHandler>("drag_handler", (e, h) => e.SetDragHandler(h), e => e.GetDragHandler()); engine.AddSimpleInstancer <DropHandler_Internal_FunctionSyncro>("DropHandler"); engine.AddAttributeFunction <DropHandler_Internal_FunctionSyncro>("on_enter", (h, f) => h.SetOnEnter(f)); engine.AddAttributeFunction <DropHandler_Internal_FunctionSyncro>("on_over", (h, f) => h.SetOnOver(f)); engine.AddAttributeFunction <DropHandler_Internal_FunctionSyncro>("on_leave", (h, f) => h.SetOnLeave(f)); engine.AddAttributeFunction <DropHandler_Internal_FunctionSyncro>("on_drop", (h, f) => h.SetOnDrop(f)); engine.AddAttributeChildren <UIElement, DropHandler>("drop_handlers", e => e.ClearDropHandlers(), (e, h) => e.AddDropHandler(h)); }
static public void Initilize(WPFEngine engine) { engine.AddAttributeChildren <UIElement>("input_bindings", e => e.InputBindings); engine.AddSimpleInstancer("InputBinding", () => new InputBinding(EmptyCommand.INSTANCE, EmptyInputGesture.INSTANCE)); engine.AddAttributeFunction <InputBinding>("action", (b, a) => b.Command = a.GetCommand()); engine.AddAttributeLink <InputBinding>("gesture", "Gesture"); engine.AddSimpleConstructor <MouseGesture, string, string>("MouseGesture", (a, m) => new MouseGesture(a.ConvertEX <MouseAction>(), m.ConvertEX <ModifierKeys>()) ); engine.AddSimpleConstructor <KeyGesture, string, string>("KeyGesture", (k, m) => new KeyGesture(k.ConvertEX <Key>(), m.ConvertEX <ModifierKeys>()) ); }
static public void Initilize(WPFEngine engine) { engine.AddSimpleInstancer <Grid>(); engine.AddAttributeLink <Grid, string>("columns", (g, s) => g.SetColumnDefinitionString(s), g => g.GetColumnDefinitionString()); engine.AddAttributeLink <Grid, string>("rows", (g, s) => g.SetRowDefinitionString(s), g => g.GetRowDefinitionString()); engine.AddChildren <Grid>(g => g.Children); engine.AddAttributeLink <UIElement, int>("column", Grid.ColumnProperty); engine.AddAttributeLink <UIElement, int>("row", Grid.RowProperty); engine.AddAttributeLink <UIElement, int>("column_span", Grid.ColumnSpanProperty); engine.AddAttributeLink <UIElement, int>("row_span", Grid.RowSpanProperty); engine.AddSimpleInstancer <GridSplitter>(); }
static public void Initilize(WPFEngine engine) { engine.AddSimpleInstancer <DockPanel>(); engine.AddAttributeLink <UIElement, Dock>("dock", DockPanel.DockProperty); }
static public void Initilize(WPFEngine engine) { engine.AddAttributeLink <Selector, object>("selected_item", Selector.SelectedItemProperty); }
static public void Initilize(WPFEngine engine) { engine.AddSimpleInstancer <Image>("Image"); engine.AddAttributeLink <Image, ImageSource>("source", Image.SourceProperty); }
static public void Initilize(WPFEngine engine) { engine.AddAttributeLink <HeaderedContentControl, object>("header", HeaderedContentControl.HeaderProperty); }
static public void Initilize(WPFEngine engine) { engine.AddAttributeLink <ContentControl, object>("content", ContentControl.ContentProperty); engine.AddChildren <ContentControl, UIElement>(c => c.Content = null, (c, e) => c.Content = e); }