Skip to content

[Feature ]Tag property Item on Buttons and other elements #2818

@davidbuckleyni

Description

@davidbuckleyni

Summary

Please add in a tag element on buttons and various others than can be used to pass small amounts of information.

API Changes

While james gave me an excellent example of how to accomplish this here in SO https://stackoverflow.com/questions/69421588/xamarin-forms-retrieve-student-details-id-on-button-click-event-handler/69422158#69422158

In the old days we would have had the Tag attribute to be able to send small forms of information around the page if building thing dynamically such as buttons, While he did offer AutomateId as an option. He in end showed me how to use the bindcontext while that is great for various reasons.

Being able to do.

ButtonName.Tag = piece of info number string even data object was so handy.

e.g.

A new api var will need to be added to MauiButton to add the facility of Tag, or else this could be called Record or something simliar. So its not a more common name.

var button = new Button ();
button.Tag= student.Id;

This should be available in all platforms that have a button.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-generalGeneral issues that span multiple controls, or common base classes such as View or Elementt/enhancement ☀️New feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions