Please note the xctk namespace – this is a reference to the necessary namespace to use the WPF Extended Toolkit. In my code-behind, I populate my ObservableCollection with the desired colors: private void PopulateColorList()ĬolorList.Add(new ColorItem(Colors.Beige, "Beige")) ĬolorList.Add(new ColorItem(Colors.Black, "Black")) ĬolorList.Add(new ColorItem(Colors.Blue, "Blue")) ĬolorList.Add(new ColorItem(Colors.Pink, "Pink")) ĬolorList.Add(new ColorItem(Colors.Red, "Red")) ĬolorList.Add(new ColorItem(Colors.White, "White")) ĬolorList.Add(new ColorItem(Colors.Yellow, "Yellow")) Īnd in my XAML, I bind the control’s AvailableColors property to ColorList: So I created an ObservableCollection of, bound my color picker’s AvailableColors property to this collection, and was warmly greeted with a color picker that showed a limited array of colors from which to choose. It appears the color picker control is looking for a list (or collection) of types. Snooping my color control showed a binding error that couldn’t properly cast between Color and .Ī-ha! This pointed me in the right direction. Among other features, Snoop has the ability to show me which items in my visual tree are suffering from binding errors. At this point I broke out the handy Snoop utility. Each time, the control would simply render its 140+ available colors – way too many for a user to peruse and quickly choose. I tried binding the “AvailableColors” property to a List, List, and List – all to no avail. The control thankfully has an “AvailableColors” property, but I couldn’t find any documentation regarding how to configure this property – that is to say, exactly what was the control expecting? I needed a way to filter the number of available colors. Either way, this was way too many colors to present to my users for selection. Note that I didn’t say that I settled for – simply put, the controls in this collection are amazing for the price.īy default, the color picker allows the user to choose from 140 different colors – that is, if we don’t count the myriad of colors available in the Advanced portion of the control. I was in need of a WPF color picker control and settled on the Extended WPF Toolkit. jeffh0821 on Configuring Verizon FiOS router for NAT loopback.pobox on Closing a WPF Window using MVVM and minimal code-behind.Stefan on Easily create a WPF splash screen with status updates via MVVM. I suddenly can’t access my own web server within my LAN via the external WAN IP address - Boot Panic on Configuring Verizon FiOS router for NAT loopback.Implement WebClient’s asynchronous download with cancellation capability.Creating (and restarting) a single-instance WPF application with SingleInstance.cs.Configuring a cloud-based secure multi-domain web and e-mail server.NET Anti-Spam asynchronous BackgroundWorker C# Custom Dialog DispatcherTimer Invoke IP Camera MVVM PHP plug-in shortcode Single-Instance application Spam UI WebClient Wordpress WPF WWW Recent Posts
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |