Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Win: Button clicked event and command will not be occurred in EmptyView of CollectionView #19609

Open
jingliancui opened this issue Dec 28, 2023 · 4 comments · May be fixed by #26006
Open

Win: Button clicked event and command will not be occurred in EmptyView of CollectionView #19609

jingliancui opened this issue Dec 28, 2023 · 4 comments · May be fixed by #26006
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@jingliancui
Copy link
Contributor

Description

Button clicked event and command will not be occurred in EmptyView of CollectionView

Steps to Reproduce

  1. open sln using vs 2022
  2. set a break point on Button_Clicked event of MainPage.xaml.cs
  3. f5 to run the app
  4. click the button

Link to public reproduction project repository

https://github.com/jingliancui/EmptyViewIssue

Version with bug

8.0.3

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Win 19041

Did you find any workaround?

no

Relevant log output

no
@jingliancui jingliancui added the t/bug Something isn't working label Dec 28, 2023
@Eilon Eilon added the area-controls-collectionview CollectionView, CarouselView, IndicatorView label Dec 29, 2023
@Brosten
Copy link

Brosten commented Jan 10, 2024

Just stumbled upon the same issue. Would be nice with a fix!

@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jan 25, 2024
@XamlTest
Copy link

XamlTest commented Jan 25, 2024

Verified this on Visual Studio Enterprise 17.9.0 Preview 3(8.0.3). Repro on Windows 11, not repro on Android 14.0-API34, iOS 17.2 and MacCatalyst with below Project:
SampleApp.zip

@jsuarezruiz jsuarezruiz added this to the Backlog milestone Jun 5, 2024
@samhouts samhouts removed s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 3, 2024
@samhouts samhouts added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 10, 2024
@rmarinho rmarinho modified the milestones: Backlog, .NET 9 SR2 Nov 20, 2024
@rmarinho
Copy link
Member

Still happening on 9.0.10

@rmarinho
Copy link
Member

As a workaround one can replace the default ControlTemplate for FormsListView the custom implementation of Windows
Goinng to App.Xaml on your Platform/Windows fodler

	xmlns:localWindows="using:Microsoft.Maui.Controls.Platform">
	<maui:MauiWinUIApplication.Resources>
		<ResourceDictionary>
			<ControlTemplate x:Key="FormsListViewTemplate" TargetType="localWindows:FormsListView">
				<Border BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}">
					<Grid>

						<ScrollViewer x:Name="ScrollViewer" 
                                TabNavigation="{TemplateBinding TabNavigation}"
                                HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
                                HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
                                IsHorizontalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsHorizontalScrollChainingEnabled}"
                                VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
                                VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
                                IsVerticalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsVerticalScrollChainingEnabled}"
                                IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
                                IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
                                ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}"
                                IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
                                BringIntoViewOnFocusChange="{TemplateBinding ScrollViewer.BringIntoViewOnFocusChange}"
                                AutomationProperties.AccessibilityView="Raw">
							<ItemsPresenter Header="{TemplateBinding Header}"
                                    HeaderTemplate="{TemplateBinding HeaderTemplate}"
                                    HeaderTransitions="{TemplateBinding HeaderTransitions}"
                                    Footer="{TemplateBinding Footer}"
                                    FooterTemplate="{TemplateBinding FooterTemplate}"
                                    FooterTransitions="{TemplateBinding FooterTransitions}"
                                    Padding="{TemplateBinding Padding}" />
						</ScrollViewer>
						<ContentControl x:Name="EmptyViewContentControl" HorizontalContentAlignment="Stretch" VerticalAlignment="Stretch"/>
					</Grid>
				</Border>
			</ControlTemplate>
		</ResourceDictionary>
	</maui:MauiWinUIApplication.Resources>
</maui:MauiWinUIApplication>

@rmarinho rmarinho modified the milestones: .NET 9 SR2, .NET 9 SR1.1 Nov 21, 2024
@rmarinho rmarinho moved this from Todo to In Progress in MAUI SDK Ongoing Nov 21, 2024
@PureWeen PureWeen modified the milestones: .NET 9 SR1.1, .NET 9 SR2 Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

8 participants