Grouping and Checkboxes in WPF

What I wanted was the check / uncheck behavior of checkbox (really of the base toggle button) with the mutual exclusivity behavior of a radio button.

C# (35.2 KB)
 
 
 
 
 
(0)
3,539 times
Add to favorites
3/12/2011
E-mail Twitter del.icio.us Digg Facebook
using System;
using System.Windows;

using GroupingToggleButtons;

namespace GroupingCheckboxes
{
	/// <summary>
	/// Interaction logic for Window1.xaml
	/// </summary>
	public partial class Window1 : Window
	{
		public Window1()
		{
			InitializeComponent();
		}

		private void Button_Click(object sender, RoutedEventArgs e)
		{
			ToggleButtonExtensions.SetGroupName(Group2Box1, "NewGroupName");
			ToggleButtonExtensions.SetGroupName(Group2Box2, "NewGroupName");
		}

		private void UnGroupButton_Click(object sender, RoutedEventArgs e)
		{
			ToggleButtonExtensions.SetGroupName(Group2Box1, String.Empty);
			ToggleButtonExtensions.SetGroupName(Group2Box2, String.Empty);
		}
	}
}