enisn / UraniumUI

Uranium is a Free & Open-Source UI Kit for MAUI.
Apache License 2.0
1.19k stars 142 forks source link

PikerField Selection Change Handler #594

Closed aliEsmaelFard closed 9 months ago

aliEsmaelFard commented 9 months ago

With the help of which handler we can understand the Selections Change?
<material:PickerField Title="Select View Type" ItemsSource="{Binding ControlTypeList}" Margin="0,8" />

enisn commented 9 months ago

You can use binding for SelectedItem. It'll trigger the setter of your property when it's changed.

<material:PickerField Title="Select View Type"
ItemsSource="{Binding ControlTypeList}"
Margin="0,8"
SelectedItem="{Binding SelectedItem}" />
public class YourViewModel : ViewModelBase
{
    object selectedItem;
    public object SelectedItem 
    { 
        get => selectedItem;
        set
        {
            selectedItem = value;
            // Here you can handle the changes...
        }
    }
}

I'll consider adding events & commands for selection changes, but in the current version it's possible in this way

aliEsmaelFard commented 9 months ago

thank you. i have another questions why MultiplePickerField not work in windows?

enisn commented 9 months ago

thank you. i have another questions why MultiplePickerField not work in windows?

It uses a dialog implementation, did you configure UraniumUI.Dialogs.CommunityToolkit or UraniumUI.Dialogs.Mopups?

They come with a simple configuration: https://enisn-projects.io/docs/en/uranium/latest/dialogs/Index

aliEsmaelFard commented 9 months ago

Still Not Working Even In android Device

aliEsmaelFard commented 9 months ago

And I Check Your Demo Not Working In There too

enisn commented 9 months ago

I found the problem and fixed with https://github.com/enisn/UraniumUI/pull/598

It'll be included in the next release

aliEsmaelFard commented 9 months ago

when its released?

enisn commented 9 months ago

It was shipped in v2.8.0 at the last minute 👍

aliEsmaelFard commented 9 months ago

thanks