Example #1
0
        // TODO: refactoring needed
        private void OnShowDialogEditor(object sender, ExecutedRoutedEventArgs e)
        {
            var value = e.Parameter as PropertyItemValue;

            if (value != null)
            {
                ShowDialogEditor(value);
            }
            else
            {
                var collectionItem = e.Parameter as CollectionItemValue;
                if (collectionItem != null)
                {
                    var grid = sender as EffectPropertyEditorGrid;
                    if (grid != null)
                    {
                        Editors.Editor editor = grid.GetEditors().GetEditor(collectionItem.ItemType);
                        ShowDialogEditor(collectionItem, editor);
                    }
                }
            }
        }
Example #2
0
        private void OnShowGradientLevelCurveCommand(object sender, ExecutedRoutedEventArgs e)
        {
            var collectionItem = e.Parameter as CollectionItemValue;

            if (collectionItem != null)
            {
                var grid = sender as EffectPropertyEditorGrid;
                if (grid != null)
                {
                    Editors.Editor    editor = grid.GetEditors().GetEditor(typeof(Curve));
                    GradientLevelPair glp    = collectionItem.Value as GradientLevelPair;
                    if (glp != null)
                    {
                        var newValue = editor.ShowDialog(collectionItem.ParentProperty, glp.Curve, this);
                        if (newValue is Curve)
                        {
                            var newGradientLevelPair = new GradientLevelPair(glp.ColorGradient, (Curve)newValue);
                            collectionItem.Value = newGradientLevelPair;
                        }
                    }
                }
            }
        }
Example #3
0
        private void ShowDialogEditor(CollectionItemValue value, Editors.Editor editor)
        {
            // TODO: Finish DialogTemplate implementation

            value.Value = editor.ShowDialog(value.ParentProperty, value.Value, this);
        }