<commit_before>using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Eto.Drawing;
using System.Collections.ObjectModel;
#if XAML
using System.Windows.Markup;
#endif

namespace Eto.Forms
{
	public interface IListControl : ICommonControl
	{
		IListStore DataStore { get; set; }
		
		int SelectedIndex { get; set; }
	}
	
	public interface IListStore : IDataStore<IListItem>
	{
	}
	
	public class ListItemCollection : DataStoreCollection<IListItem>, IListStore
	{
		public void Add (string text)
		{
			base.Add (new ListItem{ Text = text });
		}
	}
	
#if XAML
	[ContentProperty("Items")]
#endif
	public class ListControl : CommonControl
	{
		public event EventHandler<EventArgs> SelectedIndexChanged;

		IListControl handler;

		public virtual void OnSelectedIndexChanged (EventArgs e)
		{
			if (SelectedIndexChanged != null)
				SelectedIndexChanged (this, e);
		}

		protected ListControl (Generator g, Type type, bool initialize = true)
			: base (g, type, initialize)
		{
			handler = (IListControl)base.Handler;
		}
		
		public ListItemCollection Items {
			get {
				var items = (ListItemCollection)DataStore;
				if (items == null) {<commit_msg>ListItemCollection.Add prototype added with text & key<commit_after>using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Eto.Drawing;
using System.Collections.ObjectModel;
#if XAML
using System.Windows.Markup;
#endif

namespace Eto.Forms
{
	public interface IListControl : ICommonControl
	{
		IListStore DataStore { get; set; }
		
		int SelectedIndex { get; set; }
	}
	
	public interface IListStore : IDataStore<IListItem>
	{
	}
	
	public class ListItemCollection : DataStoreCollection<IListItem>, IListStore
	{
		public void Add (string text)
		{
			base.Add (new ListItem{ Text = text });
		}

		public void Add (string text, string key)
		{
			base.Add (new ListItem { Text = text, Key = key });
		}
	}
	
#if XAML
	[ContentProperty("Items")]
#endif
	public class ListControl : CommonControl
	{
		public event EventHandler<EventArgs> SelectedIndexChanged;

		IListControl handler;

		public virtual void OnSelectedIndexChanged (EventArgs e)
		{
			if (SelectedIndexChanged != null)
				SelectedIndexChanged (this, e);
		}

		protected ListControl (Generator g, Type type, bool initialize = true)
			: base (g, type, initialize)
		{
			handler = (IListControl)base.Handler;
		}
		
		public ListItemCollection Items {
			get {
				var items = (ListItemCollection)DataStore;
				if (items == null) {
{'fraction_non_alphanumeric': 0.09294998030720757, 'fraction_numerical': 0.0, 'mean_word_length': 4.1313131313131315, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4925506', 'n_tokens_mistral': 875, 'n_tokens_neox': 766, 'n_words': 221}