From 2d15767f00d67337c7de6cc23c344aa70016ce1b Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Mon, 18 Sep 2023 13:12:28 +0800
Subject: [PATCH] feat: demo page.
---
.../Pages/ElasticWrapPanelDemo.axaml | 646 +++++++++++++++++-
src/Ursa/Controls/ElasticWrapPanel.cs | 6 +-
2 files changed, 645 insertions(+), 7 deletions(-)
diff --git a/demo/Ursa.Demo/Pages/ElasticWrapPanelDemo.axaml b/demo/Ursa.Demo/Pages/ElasticWrapPanelDemo.axaml
index cbe4dfc..c41ea21 100644
--- a/demo/Ursa.Demo/Pages/ElasticWrapPanelDemo.axaml
+++ b/demo/Ursa.Demo/Pages/ElasticWrapPanelDemo.axaml
@@ -5,8 +5,646 @@
xmlns:u="https://irihi.tech/ursa"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Ursa.Demo.Pages.ElasticWrapPanelDemo">
-
-
-
-
+
+
+
+
+
+
+ Vertical
+ Horizontal
+
+
+
+ Auto
+ Disabled
+ Hidden
+ Visible
+
+
+
+ Auto
+ Disabled
+ Hidden
+ Visible
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Top
+ Center
+ Bottom
+ Stretch
+
+
+ Left
+ Center
+ Right
+ Stretch
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Ursa/Controls/ElasticWrapPanel.cs b/src/Ursa/Controls/ElasticWrapPanel.cs
index 6195ff4..a63d6ee 100644
--- a/src/Ursa/Controls/ElasticWrapPanel.cs
+++ b/src/Ursa/Controls/ElasticWrapPanel.cs
@@ -12,9 +12,9 @@ public class ElasticWrapPanel : WrapPanel
static ElasticWrapPanel()
{
IsFillHorizontalProperty.Changed.AddClassHandler(OnIsFillPropertyChanged);
- IsFillHorizontalProperty.Changed.AddClassHandler(OnIsFillPropertyChanged);
+ IsFillVerticalProperty.Changed.AddClassHandler(OnIsFillPropertyChanged);
- AffectsMeasure(IsFillHorizontalProperty, IsFillHorizontalProperty);
+ AffectsMeasure(IsFillHorizontalProperty, IsFillVerticalProperty);
}
#region AttachedProperty
@@ -95,7 +95,7 @@ public class ElasticWrapPanel : WrapPanel
childFixConstraint = new Size(constraint.Width, itemHeight);
break;
case Orientation.Vertical when itemWidthSet:
- childFixConstraint = new Size(itemWidth, itemHeight);
+ childFixConstraint = new Size(itemWidth, constraint.Height);
break;
}