From 988719b133d4d2852ce22808efea6b4ed9d12368 Mon Sep 17 00:00:00 2001 From: "EU\\amosekr" Date: Tue, 2 Dec 2025 11:52:15 +0530 Subject: [PATCH 1/2] Dropdown popup is not opening in .net 10 #457 --- .../Controls/DropDown/DropDownContents.xaml.cs | 11 ++++++++--- .../Controls/DropDown/TMDropDown.xaml.cs | 7 ++++--- .../Controls/Popup/Animations/RevealAnimation.cs | 2 +- .../Trimble.Modus.Components.csproj | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Trimble.Modus.Components/Controls/DropDown/DropDownContents.xaml.cs b/Trimble.Modus.Components/Controls/DropDown/DropDownContents.xaml.cs index d1b1eb6d..bff765ba 100644 --- a/Trimble.Modus.Components/Controls/DropDown/DropDownContents.xaml.cs +++ b/Trimble.Modus.Components/Controls/DropDown/DropDownContents.xaml.cs @@ -39,17 +39,18 @@ internal DropDownContents(View anchorView, Enums.ModalPosition position) : base( public Thickness Margin { get; set; } public IEnumerable ItemSource { get; set; } public double DesiredHeight { get; set; } + public double DesiredWidth { get; set; } public EventHandler SelectedEventHandler { get; set; } public int SelectedIndex { get; set; } public double YPosition { get; set; } public new double Height { get; set; } - + public Action ChangeIndicatorWhenPopupRemove { get; set; } public void Build() { Animation = new RevealAnimation(DesiredHeight); border.Margin = Margin; border.HeightRequest = DesiredHeight; - border.WidthRequest = WidthRequest; + border.WidthRequest = DesiredWidth; listView.ItemsSource = ItemSource; if (SelectedIndex < 0) { @@ -70,7 +71,11 @@ public void Build() #endif } } - + protected override void OnDisappearing() + { + base.OnDisappearing(); + ChangeIndicatorWhenPopupRemove?.Invoke(); + } private static void UpdateBackgroundColorOfCell(ListView listView) { if (listView.SelectedItem != null) diff --git a/Trimble.Modus.Components/Controls/DropDown/TMDropDown.xaml.cs b/Trimble.Modus.Components/Controls/DropDown/TMDropDown.xaml.cs index 4df2567d..a736be18 100644 --- a/Trimble.Modus.Components/Controls/DropDown/TMDropDown.xaml.cs +++ b/Trimble.Modus.Components/Controls/DropDown/TMDropDown.xaml.cs @@ -244,10 +244,11 @@ private async void Open() SelectedItem = this.SelectedItem, Margin = margin, DesiredHeight = desiredHeight, - WidthRequest = innerBorder.Width, + DesiredWidth = innerBorder.Width, SelectedEventHandler = OnSelected, YPosition = loc.Y, - Height = height + Height = height, + ChangeIndicatorWhenPopupRemove = OnPopupRemoved }; dropDownContents.Build(); await Task.WhenAll( @@ -260,7 +261,7 @@ await Task.WhenAll( } } - private void OnPopupRemoved(object sender, EventArgs e) + private void OnPopupRemoved() { Close(); } diff --git a/Trimble.Modus.Components/Controls/Popup/Animations/RevealAnimation.cs b/Trimble.Modus.Components/Controls/Popup/Animations/RevealAnimation.cs index 5204c693..291cda94 100644 --- a/Trimble.Modus.Components/Controls/Popup/Animations/RevealAnimation.cs +++ b/Trimble.Modus.Components/Controls/Popup/Animations/RevealAnimation.cs @@ -19,7 +19,7 @@ public override void Preparing(View content, PopupPage page) if (HasBackgroundAnimation) { _defaultOpacity = page.Opacity; - page.HeightRequest = 0; + //page.HeightRequest = 0; } else if (content != null) { diff --git a/Trimble.Modus.Components/Trimble.Modus.Components.csproj b/Trimble.Modus.Components/Trimble.Modus.Components.csproj index 6c88cb61..45e4737b 100644 --- a/Trimble.Modus.Components/Trimble.Modus.Components.csproj +++ b/Trimble.Modus.Components/Trimble.Modus.Components.csproj @@ -27,7 +27,7 @@ True Trimble.Modus.Components Trimble Modus - 1.4.0.2 + 1.4.0.3 Trimble Inc Trimble Inc Trimble.Modus.Components From 8599a70db6bf8d15781821041a48b5849294b86a Mon Sep 17 00:00:00 2001 From: "EU\\amosekr" Date: Tue, 2 Dec 2025 13:26:25 +0530 Subject: [PATCH 2/2] Fixed review comment --- .../Controls/DropDown/TMDropDown.xaml.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Trimble.Modus.Components/Controls/DropDown/TMDropDown.xaml.cs b/Trimble.Modus.Components/Controls/DropDown/TMDropDown.xaml.cs index a736be18..dc29926b 100644 --- a/Trimble.Modus.Components/Controls/DropDown/TMDropDown.xaml.cs +++ b/Trimble.Modus.Components/Controls/DropDown/TMDropDown.xaml.cs @@ -384,7 +384,12 @@ public void Dispose() SelectionChanged = null; SelectionChangedCommand = null; ItemsSource = null; - dropDownContents = null; + if (dropDownContents != null) + { + dropDownContents.ChangeIndicatorWhenPopupRemove = null; + dropDownContents = null; + } previousSelection = null; + } }