I Have a Silverlight WPF app that shows tabs of data in this case I have a new pulldown of status here is what the pulldown looks like:
screen shot http://www.mediafire.com/download.php?vkwvj6qq6q6zjoz
the code to process this is here: it is not doing it. We want the user to be able to filter the detail view by status in that combo box. any ideas why it would not display anything. i try the only status we are showing the ‘NOT STARTED – LATE’ and it displays a blank screen.
private String _Type;
private String AssessmentType
{
get { return _Type; }
set { if (this.SetReferenceProperty("AssessmentType", ref _Type, value))
{ RefreshData(); }
}
}
assessment type is defined:
private readonly String[] _assessmentType = new String[]
{ "All", "UnCompleted", "Completed", "Incomplete Late",
"NOT STARTED - LATE", "Submitted", "Submitted Late" };
RibbonControlHelper.CreateComboBox("Assessment", "Assessment",
"Select Assessment to show.", _assessmentType, (type) =>
{ AssessmentType = type; }))
protected override void RefreshData()
{
if (FacilitiesAreChanging) { return; }
Loading = true;
SchedulesRepository.Details(FacilitySelectionService.SelectedFacilities,
UnitCode, AssessmentType, StartDate, EndDate,
(schedules) =>
{
var data = new ListCollectionView(schedules);
data.GroupDescriptions.Add(new PropertyGroupDescription
("FACILITY_KEY"));
data.GroupDescriptions.Add(new PropertyGroupDescription
("UNIT"));
Data = data;
Loading = false;
});
}
Have you looked into PropertyBinding and DataContext in WPF? There you can use System.Collections.ObjectModel.ObservableCollection http://msdn.microsoft.com/en-us/library/ms668604.aspx bind it to the DataSource and everytime the Collection Changes, the ComboBox changes the Conntent-Datat itself without having manualy update every single UI-Controll in a setter.