C
C#2y ago
Usman

How to pass custom arguments to MAUI button click

So I am a JavaScript dev and recently started learning MAUI and C#. I still dont know much about C# but I am familiar with basic stuff. I wanted to ask that I want to have a button in my MAUI app and when one clicks on it, that fetches data from the GitHub API but I need some custom query params in it So I was confused to how can I pass in custom query params through arguments in this method I created
3 Replies
Buddy
Buddy2y ago
I highly recommend using bindings and MVVM Toolkit library https://learn.microsoft.com/en-us/windows/communitytoolkit/mvvm/relaycommand use Command property and CommandParameter or use MVVM (which is recommended)
Usman
Usman2y ago
I am using that itself but haven;t made the UI yet I'll do it and let u know
Starlk
Starlk2y ago
You have to initialize the variables: language, q, starsQuery etc...