xamarin-forms | Xamarin.Forms sample projects | Form library
kandi X-RAY | xamarin-forms Summary
kandi X-RAY | xamarin-forms Summary
Xamarin.Forms sample projects
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of xamarin-forms
xamarin-forms Key Features
xamarin-forms Examples and Code Snippets
Community Discussions
Trending Discussions on xamarin-forms
QUESTION
I am trying to use MVVM and ListView for the first time. I am working from Xamarin.Forms multi column table GUI
My ViewModel looks like this
...ANSWER
Answered 2021-Jun-10 at 01:38In short, incorrect data type for your ListView items.
- Define your model in an individual class
(No need to implement INotifyPropertyChanged for model classes but do that in BaseViewModel)
QUESTION
I followed https://docs.microsoft.com/en-us/xamarin/xamarin-forms/xaml/resource-dictionaries#stand-alone-resource-dictionaries but i get the error.
XFC0124 Resource "ResourceDictionary1.xaml" not found.
my code is
ResourceDictionary1.xaml (code-behind deleted) compile option: embeded resource
...ANSWER
Answered 2021-Jun-09 at 06:49I test with the steps provided in the link , everything works fine .
Check the steps below
3.Remove x:Class="FormsApp.ResourceDictionary1"
in the xaml and change the tag from ContentView
to ResourceDictionary
.
QUESTION
I have a Xamarin Forms app that needs to call a web page that contains a custom Bing Map and on the web page it needs to be able to get the users current location.
The app already has the required "app" permissions for both Android and iOS and I can get the users location internally in the app without issues.
When I call my external web page that has a custom Bing Map, it does allow me to get the users location in both Android and iOS BUT on iOS it asks the user "website... Would Like To Use Your Current Location. Don't Allow / OK" each time they visit the web page from inside my Xamarin app.
I found the following articles that help point me in the right directions but I just don't understand enough of iOS to piece it together.
How to prevent WKWebView to repeatedly ask for permission to access location? -- This looks like what I need but it is in iOS and does not use WkWebViewRender which is required for newer iOS apps.
https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/hybridwebview -- This shows me how to add "script" to the iOS side but I can't get the DidReceiveScriptMessage method to fire.
Here is my current implementation of WkWebViewRender.
...ANSWER
Answered 2021-Jun-03 at 09:43Try to create a new class which inherit from WKScriptMessageHandler
to handle the DidReceiveScriptMessage
method .
Modify your code as below
- Change the
Handler
QUESTION
Hi so I've implemented a method based on this answer: How to get notification in xamarin forms on firebase data change? But I'm having trouble getting it working.
Here's my code:
...ANSWER
Answered 2021-Jun-01 at 19:41So I worked out how to do it through using Google Cloud Functions in the Firebase console.
Step 1. Set up FCM in your .Net code
Follow this tutorial: https://docs.microsoft.com/en-us/xamarin/android/data-cloud/google-messaging/remote-notifications-with-fcm?tabs=macos
Once you have got your FCM token from that device, you can add it to your realtime database (I did this myself in the firebase console manually for testing).
Step 2. Set up Cloud Functions
Follow this tutorial: https://www.youtube.com/watch?v=bpI3Bbhlcas&t=1104s&ab_channel=uNicoDev
Step 3. Create a function to send the message
You can use this node.js code in your cloud functions to send up to 500 devices:
QUESTION
I am referring to this blog for listing the phone contacts. It is working fine on the ios part but on android part, the contacts are not listing. There are no exceptions or errors but the UI is blank.
As per the blog I have done the below things on the android platform:
- created the model class Contact and interface IContactsService.
- Added READ_CONTACTS permission and added ContactsService implementation.
- Installed Plugin.CurrentActivity and Acr.UserDialogs packages.
- Added Permission.Util class into the Android project.
- Added required things on the MainActivity and ContactPage files on the Main project.
Don't know what I am missing on the android part, on ios it is working fine. On android, the contact permission is not asking during runtime. I manually add the permission from the app settings, but no luck. My Xamarin forms version: 4.8.0.1821
I am uploading a sample project here for reference.
Thanks in advance.
...ANSWER
Answered 2021-Jun-01 at 10:15Got the answer from my Microsoft QA thread:
Android 10 does not use Android.Support.V4.Content.ContextCompat to request permission, so please use Xamarin.Essentials: Permissions to request runtime permission.
On ContactsViewModel.cs, add CheckAndContactsReadPermission()method in LoadContacts method like following code.
QUESTION
I want to set second label in info window on xamarin map. I use this example.
So exactly I want to set one variable who come from date base on info window like a second label:
...ANSWER
Answered 2021-May-31 at 09:33You could get the CustomPin
with the GetCustomPin
method in the custom renderer like the sample in your above link.
QUESTION
I want to change the current marker on xamarin.forms.maps
with icon.
On my project I create CustomMap.cs
class and CustomPin.cs
class with this code:
ANSWER
Answered 2021-May-29 at 16:39Like jason said there is complete sample app in the link you provided.Sample map app
You need to create a custom map renderer in your android project folder like this. Create a class named CustomMapRenderer
QUESTION
I'm looking to send a notification to the user when something changes in my firebase realtime database. I've set up FCM in my Xamarin.Android application. I'm pretty new to Firebase though so I'm a bit confused as to how Database Triggers work. (https://firebase.google.com/docs/functions/database-events)
I'm confused as to whether the functionality for this, ie "OnCreate" or "OnWrite" is written on the Google Cloud Platform or my C# code?
To put it another way, do i either:
- Write the code in TypeScript to detect changes in my database then push a notification through FCM, or
- Write the code in C# to detect changes, like this: How to get notification in xamarin forms on firebase data change?
Thanks.
...ANSWER
Answered 2021-May-24 at 22:38To send messages to devices through FCM, you must specify the FCM server* key in your code. As its name implies, this key should only be used in server-side code, or in an otherwise trusted environment. The reason for this is that anyone who has the FCM server key can send whatever message they want to all of your users. If you were to include this key in your client-side C# code, a malicious user can find it and you're putting your users at risk.
Cloud Functions allow you to run small snippets of Node.js code on Google Cloud's servers that run in response to events within your Cloud/Firebase project, such as when a document is written to Cloud Firestore. This code runs on Google's servers, so are the perfect spot to call the FCM API to send notifications.
That's also why you'll see many examples of this approach. But if you have another server-side platform already, it is also totally fine to call the FCM API to send notifications from there.
QUESTION
I have been looking through ways to **debug external projects like BaseLibrary **. So I haven't seen such a code structure or worked on it. I think I can debug those projects with the use of the .pdb file present in the output.
This is how the project structure looks like. And I will be debugging the last project which is being highlighted. I have gone through these links
https://docs.microsoft.com/en-us/xamarin/xamarin-forms/internals/sourcelink?pivots=windows
I have added references for pdb file. I'm not sure if it is incorrect format the reference of pdb file is C:\Workspace\Xamarin.IntegrationLibrary\Output\netstandard2.1 as you can see in the following image.
But they are not helping me with my requirement because it is talking about debugging the NuGet packages which I'm installing in my current project. I want to debug the external projects. Currently, I'm able to navigate to assembly of the base library but I'm not able to navigate to source code or methods. As you can see in the following image.
I even tried debugging in dnSpy but I'm not able to give the executable for that. Also, it is not exactly what I require because I have to debug within the project using pdb.
Some solution says double-clicking on the DLL in the module opens the source code. Well I tried that as well as you can see the following screenshot
I am able to load the .pdb symbols but I want to navigate and debug the source code of base library and integration library from xamarin.xyzApp project. I have no clue how to proceed with this. Any suggestions?
...ANSWER
Answered 2021-May-10 at 09:00Maybe you could try debugging with dnspy (https://github.com/dnSpy/dnSpy)... it allows for debugging most .net projects even without having source code, because it decompiles on demand. You can attach to running process or start from dnspy debugger. Debug/windows/modules to find the dll's, double click on any one of them to view source code and set breakpoints
QUESTION
I need to make a Multilevel Listview in Xamarin forms.
Currently, I am using this for my Single level Grouping in my Menu Page
http://www.compliancestudio.io/blog/xamarin-forms-expandable-listview
I need to update something like the attached image. I have tried some of the Solution but all in vain.
Anyone has any idea about this.
Thanks
...ANSWER
Answered 2021-May-18 at 06:48You could do this with Expander
of Xamarin Community Toolkit
.
Install Xamarin Community Toolkit
from NuGet: https://www.nuget.org/packages/Xamarin.CommunityToolkit/
Usage: xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
Xaml:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install xamarin-forms
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page