Storm-react-diagrams: Remove selected items from canvas - reactjs

I can't figure out how to remove selected items from canvas. Is there a function for that? It can be easily done when I click the backspace button.

Related

wpf custom combobox with datagrid but after popup dorpdown the first item is not selected

i have customed a wpf combobox with a datagrid in it.
After you click the toggle button of the combobox, it will open the dropdown popup and show the datagrid like the image below.
cilck the toggle buttom to show the whole result
Now my question is why the first item in the datagrid in the dropdown popup is not selected?And if after i press the down arrow key, it will select the second(like the image below press the down arrow key right after the dropdown shows) item which makes me fell that the first item is somehow selected but the highlight background is not shown.
Is this about the focus or anything else? Really no idea here , Thanks in advance.

How to add a specific item as the last item of listview

I have a ListView control which is bound to a ObservableCollection, I want to add a specific button at the end of the last item, so that when user click the button, clear up the colltions, then hide the button. Also, if the collection is empty, don't like the button display. After searching, I found many solutions on how to change the last item's style, but in my scenario, the button isn't the element of the ItemsSource. Anyone can help?
Thanks
Add the button to the template so it appears on every element in the ListView. Then use a trigger to show/hide the button based on whether the item is the last item in the list.
One way to do this is to expose the last item in your list via a property on your ViewModel. The trigger should compare the DataContext of the template, which is the current item, against the LastItem. Success should set the visibility of the button.
I hope this helps.

Drag a not selected item from list with an already selected item does not come into drag info on mouse down event?

In WPF ItemsControl, dragging an item (not selected) with an already selected item with control key pressed, does not give the clicked item into selected items list of the items control. Therefor the second item (which wasn't selected but dragged) never gets dropped as it is not in the selected list of items control.
The DragInfo object is being created on drag source's mouse left button down event.
Instead of using the selected item, use InputHitTest in the MouseDown event to find the element that was clicked, and use this element's DataContext to create the DragInfo object.
I'm not sure if this is what you want, but you can handle OnPreviewMouseleftButtonDown event and add the dragged (but not selected) item to SelectedItems.

How to jump to the top of a ListBox?

i have a problem, i have a application with a listBox where are many items in, so it is possible to scroll.
when the user press a button a new item is added.
now i need to to the following:
when the user press the button and add a new item, the viewof the listBox should jump at the top of the list, so that the user if he scrolled down, is at the top again.
is this possible?
Yes, you can do it.
Check out the ListBox.ScrollIntoView method.

How to make the listbox rows not able to be selected?

The image above depicts a ListBox. You can see the rows are able to be selected. However they should be not selectable when i click on the row, but i have no idea on how to solve this problem.
My question is, how to make the listbox rows above not able to be selected?
The easiest solution would be to use an ItemsControl instead of a ListBox. It's a similar control that doesn't allow selection.
You can retemplate the control, removing the selected state animation. Easy to do if you have Blend.
Right click on the ListBox, select Edit Additional Templates | Edit Generated Item Container | Edit A Copy. Switch to the States tab and choose the Selected state. (For Silverlight) you should see that the Rectangle "fillColor2" has a red circle, showing it's Opacity property is animated in this state. Expand fillColor2, click Opacity, and press delete. You can also do the same for the Focused state (and MouseOver state, if you don't want a mouseover effect)

Resources