Ejemplo n.º 1
0
        private void OnColorCellsExecute(object obj)
        {
            var cellTemplateSettingsWindow = new CellTemplateSettingsWindow();

            cellTemplateSettingsWindow.Closed += (s, e) =>
            {
                if (e.DialogResult == true)
                {
                    var selector = new CellTemplateSelector();
                    selector.LowerValueTemplate  = this.CreateDataTemplate(cellTemplateSettingsWindow.LowerValueColorPicker.SelectedColor);
                    selector.HigherValueTemplate = this.CreateDataTemplate(cellTemplateSettingsWindow.HigherValueColorPicker.SelectedColor);

                    var groupDesc = obj as PropertyAggregateDescription;
                    selector.PropertyName = groupDesc.PropertyName;
                    selector.LimitValue   = double.Parse(e.PromptResult);

                    this.Pivot.CellTemplateSelector = null;
                    this.Pivot.CellTemplateSelector = selector;
                    this.isCellTemplateSelectorSet  = true;
                    (this.RemoveColorsCommand as DelegateCommand).InvalidateCanExecute();
                }
            };

            cellTemplateSettingsWindow.ShowDialog();
        }
        private void OnColorCellsExecute(object obj)
        {
            var cellTemplateSettingsWindow = new CellTemplateSettingsWindow();           

            cellTemplateSettingsWindow.Closed += (s, e) =>
            {
                if (e.DialogResult == true)
                {
                    var selector = new CellTemplateSelector();
                    selector.LowerValueTemplate = this.CreateDataTemplate(cellTemplateSettingsWindow.LowerValueColorPicker.SelectedColor);
                    selector.HigherValueTemplate = this.CreateDataTemplate(cellTemplateSettingsWindow.HigherValueColorPicker.SelectedColor);

                    var groupDesc = obj as PropertyAggregateDescription;
                    selector.PropertyName = groupDesc.PropertyName;
                    selector.LimitValue = double.Parse(e.PromptResult);

                    this.Pivot.CellTemplateSelector = null;
                    this.Pivot.CellTemplateSelector = selector;
                    this.isCellTemplateSelectorSet = true;
                    (this.RemoveColorsCommand as DelegateCommand).InvalidateCanExecute();
                }
            };

            cellTemplateSettingsWindow.ShowDialog();
        }