FrameworkElement ITypeEditor.ResolveEditor(PropertyItem propertyItem)
        {
            var type = ((DdeTable)propertyItem.Value).Type;

            switch (type)
            {
            case DdeTableTypes.Security:
                ColumnsPicker.DdeColumns = typeof(DdeSecurityColumns);
                break;

            case DdeTableTypes.Order:
                ColumnsPicker.DdeColumns = typeof(DdeOrderColumns);
                break;

            case DdeTableTypes.StopOrder:
                ColumnsPicker.DdeColumns = typeof(DdeStopOrderColumns);
                break;

            case DdeTableTypes.Trade:
                ColumnsPicker.DdeColumns = typeof(DdeTradeColumns);
                break;

            case DdeTableTypes.MyTrade:
                ColumnsPicker.DdeColumns = typeof(DdeMyTradeColumns);
                break;

            case DdeTableTypes.Quote:
                ColumnsPicker.DdeColumns = typeof(DdeQuoteColumns);
                break;

            case DdeTableTypes.EquityPosition:
                ColumnsPicker.DdeColumns = typeof(DdeEquityPositionColumns);
                break;

            case DdeTableTypes.DerivativePosition:
                ColumnsPicker.DdeColumns = typeof(DdeDerivativePositionColumns);
                break;

            case DdeTableTypes.EquityPortfolio:
                ColumnsPicker.DdeColumns = typeof(DdeEquityPortfolioColumns);
                break;

            case DdeTableTypes.DerivativePortfolio:
                ColumnsPicker.DdeColumns = typeof(DdeDerivativePortfolioColumns);
                break;

            case DdeTableTypes.CurrencyPortfolio:
                ColumnsPicker.DdeColumns = typeof(DdeCurrencyPortfolioColumns);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            this.SetBindings(SelectedColumnsProperty, propertyItem, "Value.Columns", BindingMode.OneWay);
            ColumnsPicker.SetBindings(DdeTableColumnsPicker.SelectedColumnsProperty, propertyItem, "Value.Columns", BindingMode.OneWay);

            return(this);
        }
        FrameworkElement ITypeEditor.ResolveEditor(PropertyItem propertyItem)
        {
            SetBinding(SelectedColumnsProperty, new Binding("Value")
            {
                Source = propertyItem, Mode = BindingMode.TwoWay
            });
            ColumnsPicker.SetBinding(DdeColumnsPicker.SelectedColumnsProperty, new Binding("SelectedColumns")
            {
                Source = this, Mode = BindingMode.TwoWay
            });

            return(this);
        }