Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Xaml binding property - count is 0
Message
From
13/09/2011 12:48:31
 
 
To
13/09/2011 12:32:30
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Application:
Desktop
Miscellaneous
Thread ID:
01523442
Message ID:
01523443
Views:
38
Hi,
Don't know what OCSDMultiSelector is but if the controls SelectedItems is being populated then maybe you need a different UpdateSourceTrigger to update the VM collection ?

>I have a property in a ViewModel class to hold a list of selected items. The binding in xaml works fine in TwoWay mode but if I try to reference the property the count of items is 0 while the binding clearly shows a value greater than 0. What would be the cause of this?
>
>binding
>
><ctrl:OCSDMultiSelector LabelText ="Route Manager:" x:Name="multiSelectorRouteManager" SelectedItems="{Binding SelectedRouteManagers, Mode=TwoWay}"/>
>
>
>Property in View Model
>
>public IList SelectedRouteManagers
>{
>     get
>     {
>	return _selectedRouteManagers;
>     }
>
>     set
>     {
>	if (_selectedRouteManagers != value)
>	{
>                           _selectedRouteManagers = value;
>                          OnPropertyChanged("SelectedRouteManagers");
>	}
>     }
>}
>private IList _selectedRouteManagers = new WFRouteManagerList();
>
>
>Test shows count at 0 for this property when tested anywhere like below
>
>protected override bool CanExecute()
>{
>     return View.Scope.Sites.Count > 0
>	&& ((ViewWorkflow)View).WorkflowContext.SelectedRouteManagers.Count > 0
>	&& ((ViewWorkflow)View).WorkflowContext.SelectedLOBs.Count > 0;
>}
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform