WPF drag and drop not working with empty image - wpf

I want to allow the user to drop an image from explorer onto an empty Image(Source property not set), and I want the Image to be empty by default, but the Drop event will not fire if the Image is empty and my cursor will just be a circle with a slash. I tried adding a default image to the Image and it worked just fine. Is there any way I can make this work or are there any workarounds?

try put a layout container, such as Grid, outside the Image control, set it to be transparent, and then handle the drop event in the container

Related

Changing appearence of dropped item in React DND

Is there a way to modify item once dropped into Drop Target with React DND ? I have a basic Card with an image and text block. By default, the text is not shown (display: none).
I would be able to change this attribute so that once dropped, text block is shown in drop zone..
Can someone explains me how I can do that please?
I tried with endDrag function but it is the drag source which is modified, not the drag item itself...
Thanks.

NSOutlineView spring loading exits over NSImageView but not NSButton

I have an NSOutlineView subclass that implements the NSSpringLoadingDestination.
The outline view is populated with NSTableCellViews. Each table cell view has an NSTextField and NSImageView. It looks just like the name column in the Finder window: icon and text.
When I drag a row over the text field in another row everything works fine. When the cursor goes over the NSImageView, however, the spring loading exits.
The outline view also loses the highlight for that row.
If I replace the image view with an NSButton containing the image, the spring loading does not exit. And the outline view maintains the highlight.
Can anyone tell me why an NSControl does not interrupt the spring loading but an NSImageView does?
I have tried overriding some different NSView methods but I can’t get the image view to behave like the button.
Thanks.
Even when an image view is uneditable it apparently still handles drag & drop. To fix this call the image view's unregisterDraggedTypes method.

Removing Border/Margin/Padding from Form

I created a derived Form class, with the constructor using GridLayout as a parameter.
How do I remove the white border(or the margin/padding) from a form object? I tried updating listItemGapInt in my theme.res but that failed to work.
Here is an example of a form taking up the screen. (I believe the border is coming from my Form, it may be from my GridLayout)
Override both Form and ContentPane UIID's in the theme and make sure they have 0 padding/margin:
Double click theme.res
Select "Theme"
Click Add on the bottom
Type in Form on the top combo box
Select Margin tab and uncheck the Derive flag. Do the same for padding
Repeat this with ContentPane instead of form
Press Save in the designer tool

imagelist images not available in child form .net winform

I have a dll that contains a form that is being inherited by other forms. The parent form has an imagelist with several images in it and two of these are being used in toolbar buttons. It has been working for a long time but I had to add a toolbar button and an image to go with it.
The new button with the new image displays in the designer correctly in the base form, but in an existing child form, the button doesn't display in the toolbar in the designer (although it shows up at runtime with no image). In the child form, the imagelist is present with all the original images, but the new image that I added to the base form does not appear in it.
I have tried several different icons with the same result. Interestingly when I point the new tb button to one of the images that has always existed, everything is fine in the child. It just won't handle any of the new images (I've tried icons & bitmaps). I would try to delete the toolbar and imagelist and re-create it but unfortunately I don't know where the existing images are located to be able to add them back to the new imagelist.
(VS 2010, VB.NET - but C# answers are most welcome!)
I have the same problem. My parent form have an image list wich I use to present my own control box (min, max, close). All the child forms inherit from this form and everything is ok if I don't change the elements of the list. But when I add an element or change the Image index of the control buttons, this is not reflected in the child forms. Sadly I haven't fixed it yet but what I did is:
Declare the Image list as public in the designer of the parent form
Determine the forms that don't reflect the desired change
Set Manually the desired change by adding the image to the inherited IMageLIst and changing the image index in all and every form with the bug
This is not what I intended to do by designing a parent form, but it works.

combo with search and button-reusable in extjs

i am using a factory function (which has grids within windows called using button handler)within one form.
so when i click the button and open a grid and than close it,it works correctly,
but say for example in a situation:
if i open both grids and close , and than try to open other grid the previous grids contents are loaded,but as i have set the store to load in button handler that particular store is loading correctly(i have checked with fire bug) but contents of grid are not changing
win.hide();//use to hide the window after using it
closeAction: 'hide',//in window config
I am assuming that you are using gridpanels for each of these grids. You could force the stores to reload(). Or on the Window's close or hide event, you could try and clear the data on the store or reset the gridpanel.
You may want to read up on the closeAction property on the Window object. That lets you define the behavior of the close button on the window.

Resources