public void SetupCustomUIElements(dynNodeView nodeUI) { var addButton = new DynamoNodeButton(this, "AddInPort"); addButton.Content = "+"; addButton.Width = 20; addButton.HorizontalAlignment = System.Windows.HorizontalAlignment.Center; addButton.VerticalAlignment = System.Windows.VerticalAlignment.Center; var subButton = new DynamoNodeButton(this, "RemoveInPort"); subButton.Content = "-"; subButton.Width = 20; subButton.HorizontalAlignment = System.Windows.HorizontalAlignment.Center; subButton.VerticalAlignment = System.Windows.VerticalAlignment.Top; var wp = new WrapPanel { VerticalAlignment = VerticalAlignment.Top, HorizontalAlignment = HorizontalAlignment.Center }; wp.Children.Add(addButton); wp.Children.Add(subButton); nodeUI.inputGrid.Children.Add(wp); }
public void SetupCustomUIElements(dynNodeView nodeUI) { var addButton = new DynamoNodeButton(this, "AddInPort") { Content = "+", Width = 20 }; //addButton.Height = 20; var subButton = new DynamoNodeButton(this, "RemoveInPort") { Content = "-", Width = 20 }; //subButton.Height = 20; var wp = new WrapPanel { VerticalAlignment = VerticalAlignment.Top, HorizontalAlignment = HorizontalAlignment.Center }; wp.Children.Add(addButton); wp.Children.Add(subButton); nodeUI.inputGrid.Children.Add(wp); }
public override void SetupCustomUIElements(dynNodeView nodeUI) { //add a button to the inputGrid on the dynElement var selectButton = new DynamoNodeButton() { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Top, Height = Configurations.PortHeightInPixels, }; selectButton.Click += selectButton_Click; var tb = new TextBox { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Center, Background = new SolidColorBrush(System.Windows.Media.Color.FromArgb(0, 0, 0, 0)), BorderThickness = new Thickness(0), IsReadOnly = true, IsReadOnlyCaretVisible = false, MaxWidth = 200, TextWrapping = TextWrapping.Wrap }; nodeUI.inputGrid.RowDefinitions.Add(new RowDefinition()); nodeUI.inputGrid.RowDefinitions.Add(new RowDefinition()); nodeUI.inputGrid.Children.Add(tb); nodeUI.inputGrid.Children.Add(selectButton); System.Windows.Controls.Grid.SetRow(selectButton, 0); System.Windows.Controls.Grid.SetRow(tb, 1); tb.DataContext = this; selectButton.DataContext = this; var selectTextBinding = new System.Windows.Data.Binding("SelectionText") { Mode = BindingMode.TwoWay, }; tb.SetBinding(TextBox.TextProperty, selectTextBinding); var buttonTextBinding = new System.Windows.Data.Binding("SelectedElement") { Mode = BindingMode.OneWay, Converter = new SelectionButtonContentConverter(), }; selectButton.SetBinding(ContentControl.ContentProperty, buttonTextBinding); var buttonEnabledBinding = new System.Windows.Data.Binding("CanSelect") { Mode = BindingMode.TwoWay, }; selectButton.SetBinding(Button.IsEnabledProperty, buttonEnabledBinding); }
public override void SetupCustomUIElements(object ui) { var nodeUI = ui as dynNodeView; //add a button to the inputGrid on the dynElement Button analysisResultButt = new DynamoNodeButton(); nodeUI.inputGrid.Children.Add(analysisResultButt); analysisResultButt.Margin = new Thickness(0, 0, 0, 0); analysisResultButt.HorizontalAlignment = HorizontalAlignment.Center; analysisResultButt.VerticalAlignment = VerticalAlignment.Center; analysisResultButt.Click += new RoutedEventHandler(analysisResultButt_Click); analysisResultButt.Content = "Select AR"; analysisResultButt.HorizontalAlignment = HorizontalAlignment.Stretch; analysisResultButt.VerticalAlignment = VerticalAlignment.Center; }
public override void SetupCustomUIElements(dynNodeView view) { //add a button to the inputGrid on the dynElement var readFileButton = new DynamoNodeButton { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Top, Height = Configurations.PortHeightInPixels }; readFileButton.Click += readFileButton_Click; readFileButton.Content = "Browse..."; readFileButton.HorizontalAlignment = HorizontalAlignment.Stretch; readFileButton.VerticalAlignment = VerticalAlignment.Center; var tb = new TextBox(); if (string.IsNullOrEmpty(Value)) Value = "No file selected."; tb.HorizontalAlignment = HorizontalAlignment.Stretch; tb.VerticalAlignment = VerticalAlignment.Center; var backgroundBrush = new SolidColorBrush(System.Windows.Media.Color.FromArgb(0, 0, 0, 0)); tb.Background = backgroundBrush; tb.BorderThickness = new Thickness(0); tb.IsReadOnly = true; tb.IsReadOnlyCaretVisible = false; tb.TextChanged += delegate { tb.ScrollToHorizontalOffset(double.PositiveInfinity); view.ViewModel.DynamoViewModel.ReturnFocusToSearch(); }; tb.Margin = new Thickness(0,5,0,5); var sp = new StackPanel(); sp.Children.Add(readFileButton); sp.Children.Add(tb); view.inputGrid.Children.Add(sp); tb.DataContext = this; var bindingVal = new Binding("Value") { Mode = BindingMode.TwoWay, Converter = new FilePathDisplayConverter() }; tb.SetBinding(TextBox.TextProperty, bindingVal); }
public virtual void SetupCustomUIElements(dynNodeView view) { var addButton = new DynamoNodeButton(this, "AddInPort") { Content = "+", Width = 20 }; //addButton.Height = 20; var subButton = new DynamoNodeButton(this, "RemoveInPort") { Content = "-", Width = 20 }; //subButton.Height = 20; var wp = new WrapPanel { VerticalAlignment = VerticalAlignment.Top, HorizontalAlignment = HorizontalAlignment.Center }; wp.Children.Add(addButton); wp.Children.Add(subButton); view.inputGrid.Children.Add(wp); }
public override void SetupCustomUIElements(dynNodeView nodeUI) { //add a button to the inputGrid on the dynElement var selectButton = new DynamoNodeButton() { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Center }; selectButton.Click += selectButton_Click; var tb = new TextBox { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Center, Background = new SolidColorBrush(System.Windows.Media.Color.FromArgb(0, 0, 0, 0)), BorderThickness = new Thickness(0), IsReadOnly = true, IsReadOnlyCaretVisible = false, MaxWidth = 200, TextWrapping = TextWrapping.Wrap }; nodeUI.inputGrid.RowDefinitions.Add(new RowDefinition()); nodeUI.inputGrid.RowDefinitions.Add(new RowDefinition()); nodeUI.inputGrid.Children.Add(tb); nodeUI.inputGrid.Children.Add(selectButton); System.Windows.Controls.Grid.SetRow(selectButton, 0); System.Windows.Controls.Grid.SetRow(tb, 1); tb.DataContext = this; selectButton.DataContext = this; var selectTextBinding = new System.Windows.Data.Binding("SelectionText") { Mode = BindingMode.TwoWay, }; tb.SetBinding(TextBox.TextProperty, selectTextBinding); var buttonTextBinding = new System.Windows.Data.Binding("SelectedElement") { Mode = BindingMode.OneWay, Converter = new SelectionButtonContentConverter(), }; selectButton.SetBinding(ContentControl.ContentProperty, buttonTextBinding); var buttonEnabledBinding = new System.Windows.Data.Binding("CanSelect") { Mode = BindingMode.TwoWay, }; selectButton.SetBinding(Button.IsEnabledProperty, buttonEnabledBinding); }
public override void SetupCustomUIElements(object ui) { var nodeUI = ui as dynNodeView; //add a button to the inputGrid on the dynElement var selectButton = new DynamoNodeButton { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Center }; selectButton.Click += selectButton_Click; var tb = new TextBox { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Center, Background = new SolidColorBrush(System.Windows.Media.Color.FromArgb(0, 0, 0, 0)), BorderThickness = new Thickness(0), IsReadOnly = true, IsReadOnlyCaretVisible = false }; //tb.Text = "Nothing Selected"; if (SelectedElement == null || !SelectionText.Any() || !SelectButtonContent.Any()) { SelectionText = "Nothing Selected"; SelectButtonContent = "Select Instance"; } //NodeUI.SetRowAmount(2); nodeUI.inputGrid.RowDefinitions.Add(new RowDefinition()); nodeUI.inputGrid.RowDefinitions.Add(new RowDefinition()); nodeUI.inputGrid.Children.Add(tb); nodeUI.inputGrid.Children.Add(selectButton); System.Windows.Controls.Grid.SetRow(selectButton, 0); System.Windows.Controls.Grid.SetRow(tb, 1); tb.DataContext = this; selectButton.DataContext = this; var selectTextBinding = new System.Windows.Data.Binding("SelectionText") { Mode = BindingMode.TwoWay, }; tb.SetBinding(TextBox.TextProperty, selectTextBinding); var buttonTextBinding = new System.Windows.Data.Binding("SelectButtonContent") { Mode = BindingMode.TwoWay, }; selectButton.SetBinding(ContentControl.ContentProperty, buttonTextBinding); var buttonEnabledBinding = new System.Windows.Data.Binding("CanSelect") { Mode = BindingMode.TwoWay, }; selectButton.SetBinding(Button.IsEnabledProperty, buttonEnabledBinding); }