Advertisement

03.19.2008 at 01:06PM PDT, ID: 23254968
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Binding listview to value of custom control

Tags: WPF, XAML, C#
I have created a custom control called QueryFilterManager that manages a list of QueryFilter objects.  These QueryFilter objects are used to execute methods and return their results in an IList form. I need to bind the Results of a specified QueryFilter to a listview.  When I attempt this though, the listview is never populated.  The active filter from which I am attempting to get my results is a dependency property on the QueryFilterManager control.

If I take the results of the active QueryFilter and assign it to a List that is a DependencyProperty in my OnLoaded event, the ListView will update propertly.  This however, is not an option because the active filter needs to be able to be changed at runtime.  Why is it that my binding does not work in this instance?  What can I do to make it work?

My code is as follows.  Thanks in advance for your responses.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
Form Binding
 
<z:QueryFilterManager Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" Name="QueryFilterManager"></z:QueryFilterManager>
            <z:SortableListView Grid.Row="1" Grid.Column="0" Height="Auto" Name="clientInterfacesListView" ItemsSource="{Binding QueryFilterManager.CurrentFilter.Results}" SelectionChanged="OnInterfaceSelectionChanged">
                <ListView.View>
                    <GridView>
                        <GridViewColumn Header="Client" z:SortableListView.SortCriteria="Client.DisplayName, Name" DisplayMemberBinding="{Binding Path=Client.DisplayName}" Width="Auto"/>
                        <GridViewColumn Header="Name" DisplayMemberBinding="{Binding Name}" Width="200"/>
                        <GridViewColumn Header="LastUpdateDate" DisplayMemberBinding="{Binding LastUpdateDate}"/>
                        <GridViewColumn Header="LastUpdateUser" DisplayMemberBinding="{Binding Path=LastUpdateUserID}"/>
                        <GridViewColumn Header="LastXMLUpdateDate" DisplayMemberBinding="{Binding LastXMLUpdateDate}"/>
                        <GridViewColumn Header="LastXMLUpdateUser" DisplayMemberBinding="{Binding Path=LastXMLUpdateUserID}"/>
                        <GridViewColumn Header="CreationDate" DisplayMemberBinding="{Binding CreationDate}"/>
                        <GridViewColumn Header="CreationUser" DisplayMemberBinding="{Binding Path=CreationUserID}"/>
                    </GridView>
                </ListView.View>
            </z:SortableListView>
 
 
QueryFilter Class
 
public class QueryFilter
    {
        public string FetchAPI { get { return _fetchAPI; } set { _fetchAPI = value; } }
        protected string _fetchAPI;
 
        public string FetchMethod { get { return _fetchMethod; } set { _fetchMethod = value; } }
        protected string _fetchMethod;
 
        public string CriteriaToAppend { get { return _criteriaToAppend; } set { _criteriaToAppend = value; } }
        protected string _criteriaToAppend;
 
        public int ResultCount { get { return _resultCount; } set { _resultCount = value; } }
        protected int _resultCount;
 
        public IList Results { get { return _results; } set { _results = value; } }
        protected IList _results;
 
        public string FilterName { get { return _filterName; } set { _filterName = value; } }
        protected string _filterName;
 
        public bool CountOnly { get { return _countOnly; } set { _countOnly = value; } }
        protected bool _countOnly;
 
        public object[] Arguments { get { return _arguments; } set { _arguments = value; } }
        protected object[] _arguments;       
    }
 
 
QueryFilterManager Class
 
public partial class QueryFilterManager : UserControl
    {
        protected const string linkNameBase = "filterLink";
 
        public static readonly DependencyProperty QueryFiltersProperty = DependencyProperty.Register("QueryFilters", typeof(IList<QueryFilter>), typeof(QueryFilterManager));
        public IList<QueryFilter> QueryFilters { get { return GetValue(QueryFiltersProperty) as IList<QueryFilter>; } set { SetValue(QueryFiltersProperty, value); } }
 
        public static readonly DependencyProperty CurrentFilterProperty = DependencyProperty.Register("CurrentFilter", typeof(QueryFilter), typeof(QueryFilterManager));
        public QueryFilter CurrentFilter { get { return GetValue(CurrentFilterProperty) as QueryFilter; } set { SetValue(CurrentFilterProperty, value); } }
 
        public int FilterIndex { get { return _filterIndex; } set { _filterIndex = value; } }
        protected int _filterIndex;
 
        public virtual IApplicationContext ApplicationContext { get { return _applicationContext; } set { _applicationContext = value; } }
        protected IApplicationContext _applicationContext;
 
        public virtual ICoreAPI CoreAPI { get { return ApplicationContext["CoreAPI"] as ICoreAPI; } }
 
        public QueryFilterManager()
        {
            InitializeComponent();
        }
}
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: rabidmuskrat
Solution Provided By: fs99erab
Participating Experts: 2
Solution Grade: A
Views: 357
Translate:
Loading Advertisement...
03.19.2008 at 02:34PM PDT, ID: 21166133

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.19.2008 at 02:35PM PDT, ID: 21166139

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.19.2008 at 02:41PM PDT, ID: 21166191

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.19.2008 at 03:41PM PDT, ID: 21166652

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.19.2008 at 06:20PM PDT, ID: 21167416

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 12:56AM PDT, ID: 21168986

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 07:47AM PDT, ID: 21172057

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 08:11AM PDT, ID: 21172302

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 08:18AM PDT, ID: 21172386

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 08:26AM PDT, ID: 21172478

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 10:45AM PDT, ID: 21173800

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 11:37AM PDT, ID: 21174383

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 11:46AM PDT, ID: 21174472

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 12:04PM PDT, ID: 21174665

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 12:11PM PDT, ID: 21174729

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2008 at 12:16PM PDT, ID: 21174778

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080236-EE-VQP-29 / EE_QW_2_20070628