static public void Initilize(WPFEngine engine) { engine.AddInspectedComponentsForTypes( typeof(UIElement), typeof(FrameworkElement), typeof(Border), typeof(Button), typeof(ComboBox), typeof(ContentControl), typeof(Control), typeof(Decorator), typeof(TextBoxBase), typeof(TextBox), typeof(TextBlock), typeof(HeaderedContentControl), typeof(HeaderedItemsControl), typeof(Image), typeof(ItemsControl), typeof(Panel), typeof(StackPanel), typeof(Grid), typeof(DockPanel), typeof(Menu), typeof(MenuItem), typeof(ContextMenu), typeof(ScrollViewer), typeof(Selector), typeof(TabControl), typeof(TabItem), typeof(TreeView), typeof(TreeViewItem), typeof(Window) ); }
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.AddGeneralModifier <FrameworkElement>((ex, e) => e.DataContext = ex.GetTargetInfo().GetTarget()); engine.AddAttributeValue <FrameworkElement, bool>("auto_focus", (f, v) => v.IfTrue(() => f.Focus())); engine.AddAttributeFunction <FrameworkElement>("bind_left_click", (f, a) => f.AddInputBinding(a, MouseAction.LeftClick)); engine.AddAttributeFunction <FrameworkElement>("bind_left_double_click", (f, a) => f.AddInputBinding(a, MouseAction.LeftDoubleClick)); }
static public void Initilize(WPFEngine engine) { engine.AddAttributeFunction <UIElement>("on_mouse_down", (e, f) => e.MouseDown += f.GetMouseButtonEventHandler()); engine.AddAttributeFunction <UIElement>("on_mouse_down_update", (e, f) => e.MouseMove += f.GetMouseEventHandler(z => z.IsPressed())); engine.AddAttributeFunction <UIElement>("on_mouse_move", (e, f) => e.MouseMove += f.GetMouseEventHandler()); engine.AddAttributeFunction <UIElement>("on_mouse_up", (e, f) => e.MouseUp += f.GetMouseButtonEventHandler()); engine.AddAttributeFunction <UIElement>("on_mouse_up_update", (e, f) => e.MouseMove += f.GetMouseEventHandler(z => z.IsPressed() == false)); }
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("HorizontalLayout", () => new StackPanel() { Orientation = Orientation.Horizontal }); engine.AddSimpleInstancer("VerticalLayout", () => new StackPanel() { Orientation = Orientation.Vertical }); }
static public void Initilize(WPFEngine engine) { engine.AddAttributeValue <FrameworkElement, ContextMenu>("context_menu", (f, e) => { f.ContextMenu = e; f.InvalidateVisual(); }); engine.AddSimpleInstancer <ContextMenu>(); engine.AddSimpleInstancer <Menu>(); engine.AddSimpleInstancer <MenuItem>(); engine.AddAttributeFunction <MenuItem>("command", (m, a) => m.Command = a.GetCommand()); engine.AddAttributeFunction <MenuItem>("action", (m, a) => m.Click += a.GetRoutedEventHandler()); engine.AddSimpleInstancer <Separator>(); }
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 <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 <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 <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.AddAttributeValue<Decorator, UIElement>("child", (d, e) => d.Child = e); engine.AddChildren<Decorator, UIElement>(d => d.Child = null, (d, e) => d.Child = e); }
static public void Initilize(WPFEngine engine) { engine.AddSimpleInstancer <ScrollViewer>(); engine.AddChildren <ScrollViewer, UIElement>(v => v.Content = null, (v, e) => v.Content = e); }
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 <TabControl>(); engine.AddSimpleInstancer <TabItem>(); }
static public void Initilize(WPFEngine engine) { engine.AddSimpleInstancer <ComboBox>(); }
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 <ContentControl, object>("content", ContentControl.ContentProperty); engine.AddChildren <ContentControl, UIElement>(c => c.Content = null, (c, e) => c.Content = e); }
static public void Initilize(WPFEngine engine) { engine.AddChildren <Panel>(p => p.Children); }
static public void Initilize(WPFEngine engine) { engine.AddChildren <ItemsControl>(i => i.Items); }
static public void Initilize(WPFEngine engine) { engine.AddSimpleInstancer <Window>(); engine.AddAttributeFunction <Window>("on_close", (w, s) => w.Closed += s.GetEventHandler()); }
static public void Initilize(WPFEngine engine) { engine.AddSimpleInstancer <TreeView>(); engine.AddSimpleInstancer <TreeViewItem>(); }
static public void Initilize(WPFEngine engine) { engine.AddAttributeLink <HeaderedContentControl, object>("header", HeaderedContentControl.HeaderProperty); }
static public void Initilize(WPFEngine engine) { engine.AddSimpleInstancer <Border>(); }