This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello, Please see attached file for sample project and word document with images and explanations. In summary we have a popup with a DropDownColorPicker. 1) If we open the colorpicker and select a colour which is within the main popup the colour gets selected the colorpicker closes but the main popup remains open. 2) If we open the colorpicker and select a colour which is outside the main popup the colour gets selected and both the colorpicker and the main popup close. 3) If the window is now made smaller so that the popup and colorpicker lie outside the window then the main popup remains open no matter which colour is selected. (Please see document for more details.) What I would like to have is the main popup remain open until the user clicks outside the main popup but stay open while working with the controls in the main popup. Thank you. Oscar |
|
|
Hello Oscar Thanks for the repro project. This issue is caused because the standard WPF ListBox detects selection changes as a result of mouse down actions. This leads on to the color picker closing due to a color being selected, but the mouse button is still held down at this point. Once the mouse is released, the popup detects it, and since the mouse is not over the popup, the popup also ends up closing. I think the best solution here would be for the selected color to change when the mouse is released, rather than when the mouse is pressed. Unfortunately we will not be able to add this right now, but you could have a go at implementing a custom style to change this behaviour at your end. Start by finding the color picker styles that we provide, such as in the Generic.xaml, or OfficeBlue.Common.xaml files. Copy all that you need to create your own drop down color picker style. Next, you'll need to find a way to override the default selection logic of the standard WPF ListBox control. I had tried doing this with an attached property, but it didn't work out so well, so I recommend trying to create a new class that extends the ListBox control, and override the mouse logic in there. Then in your custom color picker style, use your custom ListBox implementation, rather than the standard WPF ListBox. Then the overall problem should be solved. Let me know if you have any questions as you implement this. -Jason Fauchelle |
|