Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
430
GalleryTool - How to bind to Items
posted

I have a MVVM application and I'd like to bind my GalleryTool to a custom collection.  I found an article which mentions how to do it.

http://es.infragistics.com/community/blogs/blagunas/archive/2012/09/07/xamribbon-creating-a-color-gallery-the-mvvm-way.aspx

However, the solution presented in the article does not work for me and I keep getting the following error: A 'Binding' cannot be set on the 'SetItems' property of type 'GalleryTool'. A 'Binding' can only be set on a DependencyProperty of a DependencyObject.

So the error makes sense, I suppose. It's just that I thought the article was a workaround. Anyone know how to make the Items collection Bindable?  On a side note, why isn't it bindable to begin with?

  • 430
    Verified Answer
    posted

    Well I'll be a monkeys uncle. I don't know where the hiccup was but I scrapped my attempt to implement the AttachedProperty by reading the article and went straight into seeing if I could get the source code attached to the article to work -- sure enough, it did and with version 14.2.

    So I took the example code blocks and copied them straight into my solution as original as possible and it started working! I'm absolutely baffled as to why its suddenly working. I don't see where I went wrong as I compare the differences between my code and the example code. Perhaps Visual Studio cached one of my bad attempts and was using it when it shouldn't have? I don't know. I guess just make sure you start with the example solution in the article and work from there.

    All is well.