Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Enhancement] Add ItemFocused/ItemUnfocused event to ListView #2181

Closed
rookiejava opened this issue Mar 26, 2018 · 5 comments
Closed

[Enhancement] Add ItemFocused/ItemUnfocused event to ListView #2181

rookiejava opened this issue Mar 26, 2018 · 5 comments
Labels
a/lifecycleevents a/listview Problems with the ListView/TableView help wanted We welcome community contributions to any issue, but these might be a good place to start! inactive Issue is older than 6 months and needs to be retested proposal-accepted t/enhancement ➕ up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!

Comments

@rookiejava
Copy link
Collaborator

rookiejava commented Mar 26, 2018

Rationale

ListView currently has no events to detect whether an item receives foucs or loses focus. Especially, considering the case of using an extenral input device (e.g. remote controller) such as TV, ItemFocused and ItemUnfocused are necessary for providing better user experience.

Implementation

Add ItemFocused and ItemUnfocused events to the ListView

public event EventHandler<ItemFocusEventArgs> ItemFocused;
public event EventHandler<ItemFocusEventArgs> ItemUnfocused;
public sealed class ItemFocusEventArgs: EventArgs
{
	public ItemFocusEventArgs(object item)
	{
		Item = item;
	}
	public object Item { get; private set; }
}

Backward Compatibility

This is a brand new events, so there should not be any backward compatibility issues.

Difficulty: Easy

@pauldipietro pauldipietro added this to New in Triage Mar 26, 2018
@rookiejava rookiejava changed the title [Enhancement[ Add ItemFocused/ItemUnfocused event to ListView [Enhancement] Add ItemFocused/ItemUnfocused event to ListView Mar 26, 2018
@PureWeen
Copy link
Contributor

Can the developer just use the focused features of the view inside the listview itself?

If there's a remote control each element would have a focused event that it could react to and change how it looks or do whatever? There's also a Visual State Manager that can be used to apply different styles based on the focused state
https://xamarinhelp.com/visualstatemanager-xamarin-forms-phase-1/

There are a few ways someone can interact with items and surfacing all of these from the ListView might get a bit excessive

@PureWeen PureWeen moved this from New to Needs Info in Triage Mar 26, 2018
@rookiejava
Copy link
Collaborator Author

rookiejava commented Mar 27, 2018

I am just talking about the perspective of navigating menu items. On the TV, unlike mobile environment, moving the focus itself can be considered as an item changed. Of course, there are ItemSelected and ItemTapped in existing ListView as a event. These are similar, but a little different.

Events Mobile TV
ItemSelected Touch (or click) an item Press 'OK' button
ItemTapped Touch an item Touch an item (only touch screen TV available) or Press 'OK' Button
ItemFocused Touch (or click) an item Press arrow (Up/Donw/Left/Right) key

@jassmith jassmith removed this from Needs Info in Triage Apr 7, 2018
@jassmith
Copy link

jassmith commented Apr 7, 2018

Moved to enhancement board so its not lost in triage

@AwsomeCode
Copy link

This is useful for normal application as well. Eg. Like adding new invoice item in list. And remove the last empty option if list not focus.

@samhouts samhouts moved this from Backlog to Ready for Implementation in Enhancements Jan 3, 2019
@samhouts samhouts added inactive Issue is older than 6 months and needs to be retested help wanted We welcome community contributions to any issue, but these might be a good place to start! up-for-grabs We welcome community contributions to any issue, but these might be a good place to start! labels Feb 14, 2020
@jfversluis
Copy link
Member

Thanks for this suggestion! As Xamarin.Forms is now in maintenance mode, this will not happen anymore for Xamarin.Forms. We're only adding bugfixes and stability fixes.

If this is still important to you, make sure to check the .NET MAUI repo and see if it's already on the roadmap. If not, feel free to open a discussion to discuss a change first or open an issue with a detailed feature request. Thanks!

Enhancements automation moved this from Ready for Implementation to Closed Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/lifecycleevents a/listview Problems with the ListView/TableView help wanted We welcome community contributions to any issue, but these might be a good place to start! inactive Issue is older than 6 months and needs to be retested proposal-accepted t/enhancement ➕ up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!
Projects
Enhancements
  
Closed
Development

No branches or pull requests

6 participants