c# - Wpf Nesting Databound TabControls -
i'm pretty new wpf , i'm trying series of nested tabcontrols in order filter data, nested tabs never seem want appear.
<tabcontrol itemssource="{binding years}" selecteditem="{binding selectedyear, updatesourcetrigger=propertychanged}"> <tabcontrol.contenttemplate> <datatemplate> <tabcontrol itemssource="{binding customers}" selecteditem="{binding selectedcustomer, updatesourcetrigger=propertychanged}"> <tabcontrol.contenttemplate> <datatemplate> <!-- data filtered year , customer here --> </datatemplate> </tabcontrol.contenttemplate> </tabcontrol> </datatemplate> </tabcontrol.contenttemplate> </tabcontrol>
if use defined tabitems without databinding within first datatemplate, show no problem. there trick getting nested databound tab controls work? doing in dumb way in general?
edit: data in viewmodel meant filter observablecollection of forecast objects:
public observablecollection<forecast> forecastsnational { { return _forecastsnational ?? (_forecastsnational = new observablecollection<forecast>()); } set { set(() => forecastsnational, ref _forecastsnational, value); } }
relevant properties being: datetime forecastdate, string customername, int quantity, decimal amount
currently, "years" , "customers" collections being populated selecting distinct values forecastsnational collection:
forecastsnational.select(x => x.customer).orderby(x => x).distinct()
my plan use icollectionview on collection , apply filters using selectedyear , selectedcustomer values:
forecastsnationalcollectionview.filter = m => ((forecast)m).year == int.parse(selectedyear) && ((forecast)m).customer == selectednationalcustomer;
Comments
Post a Comment