From c00e911ce8d149e411082706bea40195a8f23778 Mon Sep 17 00:00:00 2001
From: Alex B <68120101+Alex4SSB@users.noreply.github.com>
Date: Sat, 20 Dec 2025 17:03:08 +0200
Subject: [PATCH 1/6] Remove FlowDirection Trigger from RadioButton.xaml
Setting HorizontalAlignment=Right when FlowDirection is RightToLeft achieves the exact opposite of the desired if the RadioButton's parent is also set to RightToLeft. This apparently also prevents any derived styles (and even direct control properties) from changing this behavior.
---
src/Wpf.Ui/Controls/RadioButton/RadioButton.xaml | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/Wpf.Ui/Controls/RadioButton/RadioButton.xaml b/src/Wpf.Ui/Controls/RadioButton/RadioButton.xaml
index 45995d246..20477ce10 100644
--- a/src/Wpf.Ui/Controls/RadioButton/RadioButton.xaml
+++ b/src/Wpf.Ui/Controls/RadioButton/RadioButton.xaml
@@ -230,9 +230,6 @@
-
-
-
From 57b99b458fd8d3671f00782c56e487ac0374c37e Mon Sep 17 00:00:00 2001
From: alexSSB
Date: Mon, 2 Mar 2026 20:19:40 +0200
Subject: [PATCH 2/6] =?UTF-8?q?Expander:=20Added=20support=20for=20ExpandD?=
=?UTF-8?q?irection=20=E2=80=A2=20ToggleButton=20and=20ContentPresenter=20?=
=?UTF-8?q?are=20docked=20accordingly=20=E2=80=A2=20BorderThickness=20and?=
=?UTF-8?q?=20CornerRadius=20are=20adjusted=20accordingly=20=E2=80=A2=20Re?=
=?UTF-8?q?nderTransform=20direction=20is=20adjusted=20accordingly?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/Wpf.Ui/Controls/Expander/Expander.xaml | 200 ++++++++++++++-------
1 file changed, 139 insertions(+), 61 deletions(-)
diff --git a/src/Wpf.Ui/Controls/Expander/Expander.xaml b/src/Wpf.Ui/Controls/Expander/Expander.xaml
index f7d41e0ab..9c550d66f 100644
--- a/src/Wpf.Ui/Controls/Expander/Expander.xaml
+++ b/src/Wpf.Ui/Controls/Expander/Expander.xaml
@@ -11,17 +11,55 @@
+ xmlns:system="clr-namespace:System;assembly=System.Runtime">
11,11,11,11
1
16.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -29,6 +67,7 @@
@@ -100,71 +139,110 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
-
+
-
-
-
-
-
-
-
-
-
-
+ HorizontalContentAlignment="Stretch"
+ VerticalContentAlignment="Center"
+ Content="{TemplateBinding Header}"
+ FontSize="{TemplateBinding FontSize}"
+ Foreground="{TemplateBinding Foreground}"
+ IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
+ IsEnabled="{TemplateBinding IsEnabled}"
+ OverridesDefaultStyle="True"
+ Template="{StaticResource DefaultExpanderToggleButtonStyle}" />
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 3a55cf1f115e705e2bfaa748e404733d8580171e Mon Sep 17 00:00:00 2001
From: alexSSB
Date: Mon, 2 Mar 2026 20:41:40 +0200
Subject: [PATCH 3/6] Removed redundant Grid
---
src/Wpf.Ui/Controls/Expander/Expander.xaml | 74 +++++++++++-----------
1 file changed, 36 insertions(+), 38 deletions(-)
diff --git a/src/Wpf.Ui/Controls/Expander/Expander.xaml b/src/Wpf.Ui/Controls/Expander/Expander.xaml
index 9c550d66f..11e585e61 100644
--- a/src/Wpf.Ui/Controls/Expander/Expander.xaml
+++ b/src/Wpf.Ui/Controls/Expander/Expander.xaml
@@ -140,49 +140,47 @@
-
-
+
+
+
+
+
+
+
-
+
+ Content="{TemplateBinding Content}" />
-
-
-
-
-
-
-
From 9ee280b4624fef81cd9c0020c1b9c67d86edb88c Mon Sep 17 00:00:00 2001
From: alexSSB
Date: Mon, 2 Mar 2026 21:17:26 +0200
Subject: [PATCH 4/6] - Fixed animation of left / right ExpandDirection -
Chevron is now rotated according to ExpandDirection
---
src/Wpf.Ui/Controls/Expander/Expander.xaml | 37 ++++++++++++++++++----
1 file changed, 31 insertions(+), 6 deletions(-)
diff --git a/src/Wpf.Ui/Controls/Expander/Expander.xaml b/src/Wpf.Ui/Controls/Expander/Expander.xaml
index 11e585e61..bd7aaa46a 100644
--- a/src/Wpf.Ui/Controls/Expander/Expander.xaml
+++ b/src/Wpf.Ui/Controls/Expander/Expander.xaml
@@ -42,7 +42,7 @@
-
+
@@ -51,7 +51,7 @@
-
+
@@ -86,10 +86,36 @@
x:Name="ControlChevronIcon"
FontSize="{StaticResource ExpanderChevronSize}"
Foreground="{TemplateBinding Foreground}"
- Symbol="ChevronDown24" />
+ RenderTransformOrigin="0.5, 0.5"
+ Symbol="ChevronDown24">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -220,7 +246,7 @@
-
+
@@ -238,11 +264,10 @@
-
+
-
From dc4ce015c540a11c9a3ccc8b90a53fdcb68e595d Mon Sep 17 00:00:00 2001
From: alexSSB
Date: Mon, 2 Mar 2026 22:19:49 +0200
Subject: [PATCH 5/6] Added support for ExpandDirection on ExpanderPage in the
WPF UI gallery
---
.../Views/Pages/Layout/ExpanderPage.xaml | 23 +++++++-
.../Views/Pages/Layout/ExpanderPage.xaml.cs | 55 ++++++++++++++++++-
2 files changed, 74 insertions(+), 4 deletions(-)
diff --git a/src/Wpf.Ui.Gallery/Views/Pages/Layout/ExpanderPage.xaml b/src/Wpf.Ui.Gallery/Views/Pages/Layout/ExpanderPage.xaml
index d35402431..d5c0547b0 100644
--- a/src/Wpf.Ui.Gallery/Views/Pages/Layout/ExpanderPage.xaml
+++ b/src/Wpf.Ui.Gallery/Views/Pages/Layout/ExpanderPage.xaml
@@ -18,19 +18,36 @@
+ HeaderText="An Expander with text in the header and content areas">
+
-
+
+
+
+
+
+
+
+
+
diff --git a/src/Wpf.Ui.Gallery/Views/Pages/Layout/ExpanderPage.xaml.cs b/src/Wpf.Ui.Gallery/Views/Pages/Layout/ExpanderPage.xaml.cs
index 5dbf69feb..478d13620 100644
--- a/src/Wpf.Ui.Gallery/Views/Pages/Layout/ExpanderPage.xaml.cs
+++ b/src/Wpf.Ui.Gallery/Views/Pages/Layout/ExpanderPage.xaml.cs
@@ -1,9 +1,11 @@
-// This Source Code Form is subject to the terms of the MIT License.
+// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
// All Rights Reserved.
+using System.Windows.Controls;
using Wpf.Ui.Controls;
+using Wpf.Ui.Gallery.Controls;
using Wpf.Ui.Gallery.ControlsLookup;
using Wpf.Ui.Gallery.ViewModels.Pages.Layout;
@@ -19,4 +21,55 @@ public ExpanderPage(ExpanderViewModel viewModel)
}
public ExpanderViewModel ViewModel { get; }
+
+ private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ var comboBox = (ComboBox)sender;
+ string selectedText = (string)((ComboBoxItem)comboBox.SelectedValue).Content;
+ ExpandDirection direction = Enum.Parse(selectedText);
+
+ Expander1.SetCurrentValue(Expander.ExpandDirectionProperty, direction);
+
+ switch (direction)
+ {
+ case ExpandDirection.Down:
+ Expander1.SetCurrentValue(HorizontalAlignmentProperty, HorizontalAlignment.Left);
+ Expander1.SetCurrentValue(VerticalAlignmentProperty, VerticalAlignment.Top);
+
+ ControlExample1.SetCurrentValue(ControlExample.XamlCodeProperty, """
+
+ """);
+
+ break;
+ case ExpandDirection.Up:
+ Expander1.SetCurrentValue(HorizontalAlignmentProperty, HorizontalAlignment.Left);
+ Expander1.SetCurrentValue(VerticalAlignmentProperty, VerticalAlignment.Bottom);
+
+ ControlExample1.SetCurrentValue(ControlExample.XamlCodeProperty, """
+
+ """);
+
+ break;
+ case ExpandDirection.Left:
+ Expander1.SetCurrentValue(HorizontalAlignmentProperty, HorizontalAlignment.Right);
+ Expander1.SetCurrentValue(VerticalAlignmentProperty, VerticalAlignment.Top);
+
+ ControlExample1.SetCurrentValue(ControlExample.XamlCodeProperty, """
+
+ """);
+
+ break;
+ case ExpandDirection.Right:
+ Expander1.SetCurrentValue(HorizontalAlignmentProperty, HorizontalAlignment.Left);
+ Expander1.SetCurrentValue(VerticalAlignmentProperty, VerticalAlignment.Top);
+
+ ControlExample1.SetCurrentValue(ControlExample.XamlCodeProperty, """
+
+ """);
+
+ break;
+ default:
+ break;
+ }
+ }
}
From 615367bd58a70b0492bb311597ae8502580ad0ff Mon Sep 17 00:00:00 2001
From: alexSSB
Date: Mon, 2 Mar 2026 22:27:24 +0200
Subject: [PATCH 6/6] Fixed Left and Right ExpandDirections using ActualHeight
instead of ActualWidth
---
src/Wpf.Ui/Controls/Expander/Expander.xaml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Wpf.Ui/Controls/Expander/Expander.xaml b/src/Wpf.Ui/Controls/Expander/Expander.xaml
index bd7aaa46a..fb79a5eb1 100644
--- a/src/Wpf.Ui/Controls/Expander/Expander.xaml
+++ b/src/Wpf.Ui/Controls/Expander/Expander.xaml
@@ -43,7 +43,7 @@
-
+
@@ -52,7 +52,7 @@
-
+