public TriggerWorkFlowItem(FrameworkElement parent) : base(parent) { _parent = parent; this.ItemContent = new WorkFlowItemContentBase(); this.ItemContent.ItemContentContext = new WorkFlowItemContentViewModel(); OnExecuteAction = async input => { await Task.Delay(5000); return(input); }; var uiElement = new WorkFlowItemControl(_parent) { DataContext = this }; uiElement.MouseRightButtonDown += (s, e) => { e.Handled = true; }; MenuItem menu = new MenuItem() { Header = "Start" }; menu.Click += async(s, e) => { await Start(); }; uiElement.ContextMenu = new ContextMenu(); uiElement.ContextMenu.Items.Add(menu); this.UIElement = uiElement; AddConnector(new ItemConnector(parent, 25, 25) { Type = ConnectorType.Out, Label = "Output", WorkFlowItem = this }); }
public TriggerWorkFlowItem(FrameworkElement parent) : base(parent) { this.ItemContent = new WorkFlowItemContentBase(); this.ItemContent.ItemContentContext = new WorkFlowItemContentViewModel(); OnExecuteAction = async input => { await Task.Delay(5000); return(input); }; var uiElement = new WorkFlowItemControl(parent) { DataContext = this }; MenuFlyoutItem mn = new MenuFlyoutItem() { Text = "Trigger" }; mn.Click += async(s, e) => { await Start(); }; uiElement.AddContextMenuItem(mn); uiElement.RightTapped += (s, e) => { e.Handled = true; }; this.UIElement = uiElement; AddConnector(new ItemConnector(parent, 25, 25) { Type = ConnectorType.Out, Label = "Output", WorkFlowItem = this }); }