using System.Collections.ObjectModel;
namespace DesktopMagicPluginAPI.Inputs
{
///
/// Represents a selection control with a drop-down list.
///
public class ComboBox : Element
{
private string _value;
///
/// Gets the collection used to generate the content of the .
///
public ObservableCollection Items { get; } = new ObservableCollection();
///
/// Gets the currently selected item associated with this .
///
/// If you assign a value to this property, the displayed text in the user interface will not be changed.
public string Value
{
get => _value;
set
{
if (_value != value)
{
_value = value;
ValueChanged();
}
}
}
///
/// Initializes a new instance of the class with the provided .
///
///
public ComboBox(params string[] items)
{
foreach (string item in items)
{
Items.Add(item);
}
}
}
}