My name is Edward Tanguay. I'm an American software and web developer living and working in Berlin, Germany.
2 days ago: Oh great, another "it depends" answer, isn't anything simple anymore? http://t.co/ypAZDhvX.
2 days ago: 24K sunday training: three cold 5Ks 24:14, 26:48, 29:13, 61 days to #parismarathon: http://t.co/pRWmrVui.
2 days ago: 5th grade humor: "your arithmetic is terrible, where did you learn math? / yale / yale? what's your name? / yim yonson".
4 days ago: News in slow french: nice way to keep your french up to par: audio, transcription, hover-vocabulary: http://t.co/ykqztLlM.
4 days ago: Newsinslowenglish: nice way to improve English: audio, transcription, hover-vocabulary #tesl #esl #efl: http://t.co/ehq08wQD.
4 days ago: Overheard at home: "I like my sister 23%".
4 days ago: This is the way I used to teach German pronunciation in college, fun memories: http://t.co/eRULGfun.
4 days ago: "excuse me, but, um, your location is leaking".
4 days ago: "our vision for photography in berlin is for it to be lively, progressive and active" #berlin #photography @just4you http://t.co/0I59GQeV.
4 days ago: Facebook will eventually find a way to stamp out privacy: "everyone famous to their friends & therefore public figures" http://t.co/p4V9RLSA.
4 days ago: .@nickhoward there's a global layer of educational incompetence surfacing everywhere where people want to teach instead of help people learn.
WPF CODE EXAMPLE created on Saturday, February 06, 2010 permalink
Custom ChooserGroup control which allows user to change selection kind from dropdown to radiobuttons
This is an example of how to make a control that abstracts the dropdown and radiobutton controls away so that you can make a "ChooserGroup" and then render it as a: (1) dropdown, (2) radio buttons vertical, or (3) radio buttons horizontal. This control has a custom OnChoiceItemChanged event which even abstracts the handling of a changed item no matter what type of control has been rendered.
XAML:
<Window x:Class="TestRad2343.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    WindowStartupLocation="CenterScreen"
    Title="Window1" Height="350" Width="300">
    <Window.Resources>
        <Style TargetType="{x:Type GroupBox}" x:Key="GroupBoxMain">
            <Setter Property="Padding" Value="10" />
            <Setter Property="Margin" Value="0 0 0 10" />
            <Setter Property="BorderBrush" Value="#ccc" />
            <Setter Property="BorderThickness" Value="2" />
        </Style>
        <Style TargetType="{x:Type TextBlock}" x:Key="GroupBoxHeaderMain">
            <Setter Property="FontFamily" Value="Lucida Sans" />
            <Setter Property="FontSize" Value="12" />
            <Setter Property="Foreground" Value="#aaa" />
        </Style>

    </Window.Resources>

    <StackPanel Margin="10" HorizontalAlignment="Left">

        <GroupBox Style="{DynamicResource GroupBoxMain}" Margin="0 0 0 10">
            <GroupBox.Header>
                <TextBlock Text="Switch the Chooser"
                                    Style="{DynamicResource GroupBoxHeaderMain}"/>
            </GroupBox.Header>
            <StackPanel>
                <StackPanel HorizontalAlignment="Left" VerticalAlignment="Top" >
                    <Button x:Name="ButtonForDropDown" Content="Drop Down" Padding="3" Margin="0 0 0 3" Click="Button_Click_DropDown"/>
                    <Button x:Name="ButtonForRadioButtonsHorizontal" Content="Radio Buttons Horizontal" Padding="3" Margin="0 0 0 3" Click="Button_Click_RadioButtonsHorizontal" />
                    <Button x:Name="ButtonForRadioButtonsVertical" Content="Radio Buttons Vertical" Padding="3" Margin="0 0 0 3"    Click="Button_Click_RadioButtonsVertical"/>
                </StackPanel>
            </StackPanel>
        </GroupBox>

        <StackPanel HorizontalAlignment="Left" Margin="0 0 0 10">
            <ContentControl x:Name="ControlArea"/>
        </StackPanel>

        <StackPanel HorizontalAlignment="Left" Margin="0 0 0 10">
            <Button x:Name="SubmitButton" Content="Submit" Click="Button_Click_Submit"/>
        </StackPanel>

        <TextBlock x:Name="Message" Foreground="Blue" Margin="0 0 0 10"/>
    </StackPanel>
</Window>

Code Behind:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Globalization;
using System.ComponentModel;

namespace TestRad2343
{
    public partial class Window1 : Window, INotifyPropertyChanged
    {
        #region ViewModelProperty: SelectedIdCode
        private string _selectedIdCode;
        public string SelectedIdCode
        {
            get
            {
                return _selectedIdCode;
            }

            set
            {
                _selectedIdCode = value;
                OnPropertyChanged("SelectedIdCode");
            }
        }
        #endregion //test

        private ChooserDirection chooserDirection = new ChooserDirection();
        private ChooserKind chooserKind = new ChooserKind();

        private string choices = "one, two, three, four, five, six";

        public Window1()
        {
            InitializeComponent();

            chooserKind = ChooserKind.RadioButtons;
            chooserDirection = ChooserDirection.Vertical;
            ManageButtonEnabling("radioButtonsVertical");
            SelectedIdCode = "two";

            RefreshPage();
        }

        void RefreshPage()
        {
            WrapPanel wp = new WrapPanel();
            ChooserGroup chooserGroup = new ChooserGroup("chooser1", choices, SelectedIdCode);
            chooserGroup.ChooserKind = chooserKind;
            chooserGroup.ChooserDirection = chooserDirection;
            ControlArea.Content = chooserGroup.Render();
            chooserGroup.OnChoiceItemChanged += new ChooserGroup.ChoiceItemChangedHandler(chooserGroup_OnChoiceItemChanged);

            SubmitButton.Tag = chooserGroup;
        }

        void chooserGroup_OnChoiceItemChanged(object sender, ChoiceItemArgs args)
        {
            ChooserGroup chooserGroup = sender as ChooserGroup;
            SelectedIdCode = chooserGroup.GetSelectedIdCode();
        }

        private void Button_Click_Submit(object sender, RoutedEventArgs e)
        {
            ChooserGroup chooserGroup = ((Button)sender).Tag as ChooserGroup;
            Message.Text = String.Format("You selected '{0}'.", chooserGroup.GetSelectedIdCode());
        }

        private void Button_Click_DropDown(object sender, RoutedEventArgs e)
        {
            chooserKind = ChooserKind.DropDown;
            ManageButtonEnabling("dropDown");
            RefreshPage();
        }

        private void Button_Click_RadioButtonsHorizontal(object sender, RoutedEventArgs e)
        {
            chooserKind = ChooserKind.RadioButtons;
            chooserDirection = ChooserDirection.Horizontal;
            ManageButtonEnabling("radioButtonsHoriztonal");
            RefreshPage();
        }

        private void Button_Click_RadioButtonsVertical(object sender, RoutedEventArgs e)
        {
            chooserKind = ChooserKind.RadioButtons;
            chooserDirection = ChooserDirection.Vertical;
            ManageButtonEnabling("radioButtonsVertical");
            RefreshPage();
        }

        public void ManageButtonEnabling(string buttonToEnable)
        {
            switch (buttonToEnable)
            {
                case "dropDown":
                    ButtonForDropDown.IsEnabled = false;
                    ButtonForRadioButtonsHorizontal.IsEnabled = true;
                    ButtonForRadioButtonsVertical.IsEnabled = true;
                    break;
                case "radioButtonsHoriztonal":
                    ButtonForDropDown.IsEnabled = true;
                    ButtonForRadioButtonsHorizontal.IsEnabled = false;
                    ButtonForRadioButtonsVertical.IsEnabled = true;
                    break;
                case "radioButtonsVertical":
                    ButtonForDropDown.IsEnabled = true;
                    ButtonForRadioButtonsHorizontal.IsEnabled = true;
                    ButtonForRadioButtonsVertical.IsEnabled = false;
                    break;
                default:
                    break;
            }
        }

        #region INotifiedProperty Block
        public event PropertyChangedEventHandler PropertyChanged;

        protected void OnPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;

            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
        #endregion //test

    }

    public class ChooserGroup
    {
        public ChooserDirection ChooserDirection { get; set; }
        public ChooserKind ChooserKind { get; set; }

        private string idCode;
        private List<ChoiceItem> choiceItems = new List<ChoiceItem>();
        private List<RadioButton> internalRadioButtons = new List<RadioButton>();
        private ComboBox internalComboBox = new ComboBox();
        private List<ComboBoxItem> internalComboBoxItems = new List<ComboBoxItem>();


        public delegate void ChoiceItemChangedHandler(object obj, ChoiceItemArgs args);
        public event ChoiceItemChangedHandler OnChoiceItemChanged;


        public ChooserGroup(string chooserIdCode, string choiceList, string selectedChoice)
        {
            idCode = chooserIdCode;
            List<string> choices = choiceList.BreakIntoParts(',');
            choiceItems = ChoiceItem.GetChoiceItemsWithStringList(choices, selectedChoice);
            ChooserKind = ChooserKind.RadioButtons;
            ChooserDirection = ChooserDirection.Vertical;
        }

        public StackPanel Render()
        {
            switch (ChooserKind)
            {
                case ChooserKind.RadioButtons:
                    return RenderAsRadioButtons();
                case ChooserKind.DropDown:
                    return RenderAsDropDown();
                default:
                    return new StackPanel();
            }
        }

        StackPanel RenderAsDropDown()
        {
            StackPanel spWrapper = new StackPanel();
            int index = 0;
            foreach (var choiceItem in choiceItems)
            {
                ComboBoxItem comboBoxItem = new ComboBoxItem { Tag = choiceItem.IdCode, Content = choiceItem.Title };
                internalComboBox.Items.Add(comboBoxItem);
                if (choiceItem.IsSelected)
                    internalComboBox.SelectedIndex = index;
                index++;
                internalComboBoxItems.Add(comboBoxItem);
            }
            if (internalComboBox.SelectedItem == null)
            {
                if (internalComboBox.Items.Count > 0)
                    internalComboBox.SelectedItem = internalComboBox.Items[0];
            }
            spWrapper.Children.Add(internalComboBox);

            internalComboBox.SelectionChanged += new SelectionChangedEventHandler(internalComboBox_SelectionChanged);

            return spWrapper;

        }

        void internalComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ChoiceItemArgs args = new ChoiceItemArgs("");
            OnChoiceItemChanged(this, args);
        }

        StackPanel RenderAsRadioButtons()
        {
            StackPanel spWrapper = new StackPanel();

            StackPanel spDirectionWrapper = new StackPanel();
            WrapPanel wpDirectionWrapper = new WrapPanel();

            foreach (var choiceItem in choiceItems)
            {
                RadioButton rb = new RadioButton();
                rb.Content = choiceItem.Title;
                rb.Tag = choiceItem.IdCode;
                rb.GroupName = idCode;
                rb.Cursor = Cursors.Hand;
                if (choiceItem.IsSelected)
                    rb.IsChecked = true;
                else
                    rb.IsChecked = false;

                if (ChooserDirection == ChooserDirection.Horizontal)
                {
                    rb.Margin = new Thickness(5);
                    wpDirectionWrapper.Children.Add(rb);
                }
                else
                {
                    spDirectionWrapper.Children.Add(rb);
                }
                rb.Checked += new RoutedEventHandler(rb_Checked);
                internalRadioButtons.Add(rb);
            }

            if (ChooserDirection == ChooserDirection.Horizontal)
                spWrapper.Children.Add(wpDirectionWrapper);
            else
                spWrapper.Children.Add(spDirectionWrapper);

            return spWrapper;
        }

        void rb_Checked(object sender, RoutedEventArgs e)
        {
            ChoiceItemArgs args = new ChoiceItemArgs("");
            OnChoiceItemChanged(this, args);
        }

        public string GetSelectedIdCode()
        {
            switch (ChooserKind)
            {
                case ChooserKind.RadioButtons:
                    return GetSelectedIdCodeFromRadioButtons();
                case ChooserKind.DropDown:
                    return GetSelectedIdCodeFromDropDown();
                default:
                    return "";
            }
        }

        string GetSelectedIdCodeFromRadioButtons()
        {
            foreach (var internalRadioButton in internalRadioButtons)
            {
                if (internalRadioButton.IsChecked.Value)
                    return internalRadioButton.Tag.ToString();
            }
            return null;
        }

        string GetSelectedIdCodeFromDropDown()
        {
            int selectedIndex = internalComboBox.SelectedIndex;
            ComboBoxItem selectedComboBoxItem = internalComboBoxItems[selectedIndex];
            return selectedComboBoxItem.Tag.ToString();
        }
    }

    public class ChoiceItemArgs : EventArgs
    {
        public string Message { get; set; }

        public ChoiceItemArgs(string message)
        {
            Message = message;
        }
    }

    public enum ChooserDirection
    {
        Horizontal,
        Vertical
    }

    public enum ChooserKind
    {
        DropDown,
        RadioButtons
    }

    public class ChoiceItem
    {
        public string IdCode { get; set; }
        public string Title { get; set; }
        public bool IsSelected { get; set; }

        public static List<ChoiceItem> GetChoiceItemsWithStringList(List<string> rawChoices, string selectedValue)
        {
            if (rawChoices == null)
                return null;
            List<ChoiceItem> choiceItems = new List<ChoiceItem>();
            foreach (var rawChoice in rawChoices)
            {
                ChoiceItem ci = new ChoiceItem();
                ci.IdCode = rawChoice;
                TextInfo text = new CultureInfo("en-US", false).TextInfo;
                ci.Title = text.ToTitleCase(rawChoice);
                if (ci.IdCode == selectedValue)
                    ci.IsSelected = true;
                choiceItems.Add(ci);
            }
            return choiceItems;
        }
    }

    public static class StringHelpers
    {
        public static List<string> BreakIntoParts(this string line, char separator)
        {
            if (String.IsNullOrEmpty(line))
                return null;
            else
                return line.Split(separator).Select(p => p.Trim()).ToList();
        }
    }
}
need markup?