diff --git a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ExpanderTests/Expander_Bindings_TemplatedControl.xaml b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ExpanderTests/Expander_Bindings_TemplatedControl.xaml new file mode 100644 index 000000000000..a5b63e36ea6c --- /dev/null +++ b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ExpanderTests/Expander_Bindings_TemplatedControl.xaml @@ -0,0 +1,99 @@ + + + + + + + + + + diff --git a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ExpanderTests/Expander_Bindings_TemplatedControl.xaml.cs b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ExpanderTests/Expander_Bindings_TemplatedControl.xaml.cs new file mode 100644 index 000000000000..1f820df6b935 --- /dev/null +++ b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ExpanderTests/Expander_Bindings_TemplatedControl.xaml.cs @@ -0,0 +1,53 @@ +#nullable enable +using Uno.UI.Samples.Controls; +using Microsoft.UI.Xaml.Automation.Peers; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml; +using Microsoft.Graph.Models; +using System; + +// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 + +namespace UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests; + +[Sample("Expander", "MUX", Name = "Expander_Bindings_TemplatedControl", isManualTest: true)] +public sealed partial class Expander_Bindings_TemplatedControl : UserControl +{ + public Expander_Bindings_TemplatedControl() + { + this.InitializeComponent(); + } +} + +public partial class SettingsExpander : Control +{ + public SettingsExpander() { } + + public object Header + { + get => (object)GetValue(HeaderProperty); + set => SetValue(HeaderProperty, value); + } + + public bool IsExpanded + { + get => (bool)GetValue(IsExpandedProperty); + set => SetValue(IsExpandedProperty, value); + } + protected virtual void OnIsExpandedPropertyChanged(bool oldValue, bool newValue) + { + } + + public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register( + nameof(Header), + typeof(object), + typeof(SettingsExpander), + new PropertyMetadata(defaultValue: null)); + + public static readonly DependencyProperty IsExpandedProperty = DependencyProperty.Register( + nameof(IsExpanded), + typeof(bool), + typeof(SettingsExpander), + new PropertyMetadata(defaultValue: false, (d, e) => ((SettingsExpander)d).OnIsExpandedPropertyChanged((bool)e.OldValue, (bool)e.NewValue))); +} diff --git a/src/SamplesApp/UITests.Shared/UITests.Shared.projitems b/src/SamplesApp/UITests.Shared/UITests.Shared.projitems index 13e2c051e4cd..0015b95ca483 100644 --- a/src/SamplesApp/UITests.Shared/UITests.Shared.projitems +++ b/src/SamplesApp/UITests.Shared/UITests.Shared.projitems @@ -66,6 +66,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -5461,6 +5465,9 @@ + + Expander_Bindings_TemplatedControl.xaml +