Click here to Skip to main content
15,895,746 members
Articles / Programming Languages / C#

Developing a MultiSelector

Rate me:
Please Sign up or sign in to vote.
5.00/5 (18 votes)
3 Dec 2009BSD15 min read 65.5K   1.3K   45  
A MultiSelector-derived control that supports multiple selection modes, scoped selection, customizable lasso-tool and selection logic
using System.Windows.Markup;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows;

namespace SelectionAreaSample
{
    public sealed class EllipseGeometryConverter : MarkupExtension, IMultiValueConverter
    {
        public override object ProvideValue(System.IServiceProvider serviceProvider)
        {
            return this;
        }

        #region IMultiValueConverter Members

        public object Convert(object[] values, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return new EllipseGeometry(new Rect((Point)values[0], (Point)values[1]));
        }

        public object[] ConvertBack(object value, System.Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new System.NotImplementedException();
        }

        #endregion
    }

}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The BSD License


Written By
Romania Romania
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions