Exemplo n.º 1
0
        private void measureTreeClicked(object sender, RoutedEventArgs e)
        {
            string groupName = null;

            // Need to expand or hide the relavent group
            if (measuresDataGrid == null)
            {
                return;
            }

            MeasureSelection content = (MeasureSelection)measuresDataGrid.CurrentItem;

            if (content.MeasureRowType == MeasureRowType.DataValue)
            {
                return;
            }

            groupName            = content.MeasureName;
            content.ExpandedFlag = !content.ExpandedFlag;

            // Loop through all the items and set the visibility correctly
            foreach (MeasureSelection item in measureDataModel.GetAllData())
            {
                if ((content.MeasureRowType == MeasureRowType.CategoryType) && (item.MeasureRowType == MeasureRowType.DataValue) &&
                    (string.Compare(item.Category, groupName) == 0))
                {
                    item.VisibilityMain = content.ExpandedFlag;
                }
                if ((content.MeasureRowType == MeasureRowType.SubCategoryType) && (item.MeasureRowType == MeasureRowType.DataValue) &&
                    (string.Compare(item.SubCategory, groupName) == 0))
                {
                    item.VisibilitySub = content.ExpandedFlag;
                }
                if ((content.MeasureRowType == item.MeasureRowType) && (string.Compare(groupName, item.MeasureName) == 0))
                {
                    item.ExpandedFlag = content.ExpandedFlag;
                }
            }

            // Update the visible measure collection
            measureDataModel.UpdateVisMeasureCollection();
        }