<commit_before>using System;
using Xwt.Backends;
using System.ComponentModel;
using Xwt.Drawing;

namespace Xwt
{
	public class Expander: Widget
	{
		EventHandler expandChanged;
		Xwt.Widget child;

		protected new class WidgetBackendHost: Widget.WidgetBackendHost, IExpandEventSink
		{
			public void ExpandChanged ()
			{
				((Expander)Parent).OnExpandChanged (EventArgs.Empty);
			}
		}
		
		protected override BackendHost CreateBackendHost ()
		{
			return new WidgetBackendHost ();
		}
		
		IExpandBackend Backend {
			get { return (IExpandBackend)BackendHost.Backend; }
		}

		public Expander ()
		{
		}

		public string Label {
			get {
				return Backend.Label;
			}
			set {
				Backend.Label = value;
			}
		}

		public bool Expanded {
			get {
				return Backend.Expanded;
			}
			set {
				Backend.Expanded = true;
			}
		}

		public new Widget Content {
			get { return child; }
			set {
				if (child != null)
					UnregisterChild (child);
				child = value;
				if (child != null)
					RegisterChild (child);
				Backend.SetContent ((IWidgetBackend)GetBackend (child));
				OnPreferredSizeChanged ();
			}
		}

		protected void OnExpandChanged (EventArgs args)
		{
			if (expandChanged != null)
				expandChanged (this, args);
		}

		public event EventHandler ExpandChanged {
			add {
				BackendHost.OnBeforeEventAdd (ExpandEvent.ExpandChanged, expandChanged);
				expandChanged += value;<commit_msg>[Expander] Use the actual value of the Expanded property<commit_after>using System;
using Xwt.Backends;
using System.ComponentModel;
using Xwt.Drawing;

namespace Xwt
{
	public class Expander: Widget
	{
		EventHandler expandChanged;
		Xwt.Widget child;

		protected new class WidgetBackendHost: Widget.WidgetBackendHost, IExpandEventSink
		{
			public void ExpandChanged ()
			{
				((Expander)Parent).OnExpandChanged (EventArgs.Empty);
			}
		}
		
		protected override BackendHost CreateBackendHost ()
		{
			return new WidgetBackendHost ();
		}
		
		IExpandBackend Backend {
			get { return (IExpandBackend)BackendHost.Backend; }
		}

		public Expander ()
		{
		}

		public string Label {
			get {
				return Backend.Label;
			}
			set {
				Backend.Label = value;
			}
		}

		public bool Expanded {
			get {
				return Backend.Expanded;
			}
			set {
				Backend.Expanded = value;
			}
		}

		public new Widget Content {
			get { return child; }
			set {
				if (child != null)
					UnregisterChild (child);
				child = value;
				if (child != null)
					RegisterChild (child);
				Backend.SetContent ((IWidgetBackend)GetBackend (child));
				OnPreferredSizeChanged ();
			}
		}

		protected void OnExpandChanged (EventArgs args)
		{
			if (expandChanged != null)
				expandChanged (this, args);
		}

		public event EventHandler ExpandChanged {
			add {
				BackendHost.OnBeforeEventAdd (ExpandEvent.ExpandChanged, expandChanged);
				expandChanged += value;
{'fraction_non_alphanumeric': 0.09242529534398888, 'fraction_numerical': 0.0, 'mean_word_length': 3.1069900142653353, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6136537', 'n_tokens_mistral': 1115, 'n_tokens_neox': 904, 'n_words': 219}