Persistent palettes

Jan 9, 2011 at 11:18 PM


Not sure if you get notified when patches are added, but I've uploaded #7997 for persistent palettes.

// Per

Jan 10, 2011 at 7:10 AM
Edited Jan 10, 2011 at 7:14 AM

hi Per,

yes, I noticed the patch - great work!! I will have a look at it and check it in soon!

I have not found a solution to the bug with opening/closing of the colorpicker popup yet, this problem has been added to the Issue Tracker. I hope someone who knows more about WPF can have a look!

Jan 10, 2011 at 5:22 PM

Here's some code that I was using for a color picker and a visibility picker:

            ObjectType="{x:Type sys:Enum}" 
                <x:Type TypeName="Visibility" />
            ObjectType="{x:Type sys:Type}" 
                    <sys:String>System.Windows.Media.Colors, PresentationCore,
                    Version=, Culture=neutral, 
            ObjectInstance="{StaticResource colorsTypeOdp}"  

                    ItemsSource="{Binding Source={StaticResource VisibilityValues}}"
                    SelectedItem="{Binding Path=ShowTitle}"
                    VerticalAlignment="Center" />

                    ContextMenu="{StaticResource popupMenu}"
                    ItemTemplate="{StaticResource ColorDataTemplate}"
                    ItemsSource="{Binding Source={StaticResource colorPropertiesOdp}}" 
                    SelectedValue="{Binding Path=IndicatorFg, Converter={StaticResource ColorBrushNameConverter}}" />



Jan 13, 2011 at 8:34 AM
Edited Jan 13, 2011 at 8:38 AM

hi Per, I am currently looking at the patch.

I would like to have the persistent palette a bit more compact.. Maybe info in a tooltip and icons on the load/save buttons. Could drag/drop make it even simpler than using the ctrl/shift/alt key combinations?

I think the left TabStripPlacement steals a lot of horizontal space for the color controls, I want it at the bottom as default. I have added a TabStripPlacement property to the ColorPicker to control this.

I hope we can find a better solution than the Apply button next to the hex textbox, maybe implement it as the red/green/blue textboxes?

Bill: I don't think the code you inlined helps the colorpicker. Thanks anyway for sharing!

Jan 13, 2011 at 7:06 PM

Feel free to improve upon my code. If you can make it more compact and still keep the palettes separate it's a good thing.

If you place the TabStrips at the bottom you end up with the PopUp closing when you click on a tab that is vertically smaller than the currently displayed tab.

R/G/B boxes would be an improvement over the apply button, as long as they are using the PopertyChanged setting for their binding.

Jan 17, 2011 at 10:22 PM

Objo, do you have some code that you can commit regarding this feature? I'd like to get this feature to a more finished state and don't want to do the same work as you, in case you've already done some parts.

Jan 19, 2011 at 8:33 AM

hi Per, I need a bit more time to finish what I started - I don't want to submit half-finished code. I added a property to change the position of the tabs and I will get rid of the apply button next to the hex textbox. As I mentioned in the previous post it would also be nice to use drag/drop instead of the ctrl/shift/alt keys to add to the user palette. 

Jan 19, 2011 at 12:03 PM

Ok, I can wait for that.

Drag n' drop is a nice feature, but isn't really a requirement - at least not for me or my users. Nor do I feel it as a intuitive way of doing it. Looking at other palettes I've seen in other application, they are all click-based.

An alternative to both the keys and drag n' drop is using the second button on the mouse, such as:

Right-click in fixed palette/color box: Add to persistent palette
Right-click in persistent palette: Update clicked color with the one currently in the color box.
Shift-right-click in persistent palette: Remove color.

Should be easier to implement, imho, but I'm no WPF-guru...

Jan 27, 2011 at 6:36 AM

hi Per! The recent changes look very good! There is just a little binding bug in the "CurrentStore" text field that breaks the .net 3.5 solution. I commented it out. Can you fix it?

Jan 27, 2011 at 7:33 PM