I'm building a reusable user control that will contain a search query textbox and a GridView that contains the results of the query. I have created a DependencyProperty on the user control that will hold the collection of items to be searched. Since the type of objects we will be searching and displaying on the screen varies, I also need to have the user control support custom column definitions for the GridView. I tried creating a DependencyProperty for the columns definition, but it looks like the GridView didn't support binding the columns property to it.
As it stands right now, the columns are defined from within the user control's XAML. It is fully functional. However, this breaks reusability if we want to work with a collection of a different type of object, and we don't want to auto-generate columns. Any ideas on how we can move the GridView column definitions outside of the user control but still have them written in XAML? I've done some searching for a solution but haven't found anything ideal yet.
Thanks.
As it stands right now, the columns are defined from within the user control's XAML. It is fully functional. However, this breaks reusability if we want to work with a collection of a different type of object, and we don't want to auto-generate columns. Any ideas on how we can move the GridView column definitions outside of the user control but still have them written in XAML? I've done some searching for a solution but haven't found anything ideal yet.
Thanks.