// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993] for details.
// All other rights reserved.
using System.Collections;
using System.Windows;
using System.Windows.Automation.Peers;
using System.Windows.Controls;
using System.Windows.Input;
namespace System.Windows.Controls
{
///
/// Defines an item collection, selection members, and key handling for the
/// selection adapter contained in the drop-down portion of an
/// control.
///
/// Stable
public interface ISelectionAdapter
{
///
/// Gets or sets the selected item.
///
/// The currently selected item.
object SelectedItem { get; set; }
///
/// Occurs when the
///
/// property value changes.
///
event SelectionChangedEventHandler SelectionChanged;
///
/// Gets or sets a collection that is used to generate content for the
/// selection adapter.
///
/// The collection that is used to generate content for the
/// selection adapter.
IEnumerable ItemsSource { get; set; }
///
/// Occurs when a selected item is not cancelled and is committed as the
/// selected item.
///
event RoutedEventHandler Commit;
///
/// Occurs when a selection has been canceled.
///
event RoutedEventHandler Cancel;
///
/// Provides handling for the
/// event that occurs
/// when a key is pressed while the drop-down portion of the
/// has focus.
///
/// A
/// that contains data about the
/// event.
void HandleKeyDown(KeyEventArgs e);
///
/// Returns an automation peer for the selection adapter, for use by the
/// Silverlight automation infrastructure.
///
/// An automation peer for the selection adapter, if one is
/// available; otherwise, null.
AutomationPeer CreateAutomationPeer();
}
}