Xamarin-Forms | A collection of Xamarin Forms samples | Form library
kandi X-RAY | Xamarin-Forms Summary
kandi X-RAY | Xamarin-Forms Summary
A collection of Xamarin Forms samples
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'm trying to set an image inside a RadioButton like shown at https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/radiobutton
...ANSWER
Answered 2022-Feb-23 at 16:43Please read the docs
However, on some platforms a RadioButton can display a View,
and
On Android, RadioButton objects will display a string-based representation of the View object that's been set as content:
QUESTION
I have a hard time understanding the difference between those 3 things when creating a project using Xamarin.Forms or MAUI. I know what these are - INotifyPropertyChanged
is an interface you need to implement when you want to use bindings in XAML, BindableObject
is Xamarin.Forms class that implements said interface and ObservableObject
is a class found in Xamarin Community Toolkit that also implements that interface. I just don't really understand the differences between them (especially the latter two) and when you would use any of them? I have read different tutorials and they all say different things - that you need to implement the interface yourself (so your viewmodel implements it), that your viewmodel needs to inherit from BindableObject
, or - if you're using Xamarin Community Toolkit (which you probably should use/are using) - inherit from ObservableObject
. But - like I said - why should you use any of the solutions mentioned above over the others?
If you implement INotifyPropertyChanged
interface Visual Studio (or ReSharper extension, I'm not sure which one) automatically implements the method it needs to and adds this code:
ANSWER
Answered 2022-Feb-23 at 12:53There is some confusion I think about the different classes:
Xamarin.Forms.BindableObject is meant to be used to create something like a custom view with bindable properties. It also implements INotifyPropertyChanged, but I don't think you should use it for a ViewModel.
The ObservableObject from the community toolkit can be used as a base class for any class you like to use with data binding, you don't need to implement it yourself.
If you have some custom requirements for handling the OnPropertyChanged, you do need to implement the interface yourself, but if you just want to have default behaviour, ObservableObject is perfectly fine.
QUESTION
I am trying to implement barcode scanning in my Xamarin form, but no success.
I am able to get the camera working, but I don't see the red line on the screen and it simply refuses to scan anything
I tried this answer. I can see thru my camera, but no red line appears. But I can put the torch on and off
XAML code:
...ANSWER
Answered 2022-Feb-14 at 14:57In my working project I used this xaml declaration:
QUESTION
My Xamarin.Forms app is using Shell flyouts for navigation. When I navigate the app on iOS, I notice a strange behaviour. Reproduction steps:
- Go to a page that has an
Entry
in it - Type anything into the
Entry
- Go to another page
- Return to the same page you typed something into the
Entry
The keyboard then pops up and then disappears right after. I can see the cursor in the Entry
appear then disappear too. I removed a lot of my code to try to find the problem, but I can not find it. My code:
AppShell.xaml:
...ANSWER
Answered 2022-Jan-20 at 05:06After my testing, this situation only occurs in iOS.
There is a simpler solution, you can rewrite the ContentPage and end the editing state of the page when the page loads.
First, create the MyPageRenderer class in your project's xxx.iOS directory.
Here is the internal code:
QUESTION
I have a Entry
control inside DataTemplate
of Bindable StackLayout
. I have implemented TextChanged
event of Entry
control with Behavior
but event is not getting fired.
This is xaml
code
ANSWER
Answered 2021-Dec-27 at 12:00The reason you are not able to find it is because of the context.
Give your current ContentPage a name :
QUESTION
According to doc,
Xamarin.Forms uses a system font defined by each platform.
My app uses label to display text which contains special characters like: ∫, Δ, θ, ∠,...
I've tested on my device and saw that the special characters are rendered properly, but I can't predict what will happen when these special characters not available on other devices, e.g assume one of my users has an Android device that can't render the character "∫", when the label tries to render the text "Ha Ha ∫!!!", what will happen: A. It will display "Ha Ha ?!!!" or B. It will crash the app?
I'm afraid that case B may happens, so if it does, I may consider to use pronounce instead of symbol (e.g "integral" instead of "∫") to play it safe. If the worst scenario is case A, then I'll use the symbol to make it easy to understand for the user.
...ANSWER
Answered 2021-Dec-27 at 05:13I figure it out, it will display the rectangle.
I set the text of the label to "Ha ha \U0007FFFF!!!"
and it displays like this "Ha ha [rectangle]!!!" (tested as WPF app):
QUESTION
I want to implement Password autofill functionality for my Xamarin app, i followed the steps on https://mikalaidaronin.info/blog/posts/xamarin-forms-password-autofill and it is working fine for Android, but it is not working for iOS, i do not see password save popup for my iOS app.
Is there any additional step needed apart from the mentioned on the blog above?
...ANSWER
Answered 2021-Dec-26 at 05:28I was able to fix it, for me the issue was that Entitlements.plist was not selected as "Custom Entitlements" in project settings.
QUESTION
I have been facing an issue many have been in the past but none of the solutions seem to work.
I have a Grid with in it a StackLayout with TapGesture.
...ANSWER
Answered 2021-Dec-15 at 13:03It was an issue with 'InputTransparent="True"', after rebuilding the page step by step based on comments from ToolmakerSteve I was able to fix it. Thanks for all the help.
Code
QUESTION
I have Visual Studio 2019 installed with Xamarin. I'm trying to get Shell to show up in the project templates. I'm following this post as a guide. But when I install the vsix file, it fails with the error message: Installation of Microsoft.VisualStudio.Android.DeviceManager failed. The extension has a lower version than required by Visual Studio. Please install the extension from Visual Studio Installer instead.
Where in the Visual Studio Installer is the Android Device Manager? I've installed all the Mobile Development tools and all updates....
...ANSWER
Answered 2021-Dec-14 at 21:34That post is obsolete - it describes something you needed to do in a Preview version of VS 2019.
In VS Installer, select Workload "Mobile development with .NET".
I was unable to find any Microsoft doc that tells you to simply do that!
I don't recall whether you still need to also do this step:
Setting up the Android SDK for Xamarin.Android.
After installing the Workload mentioned above, restart VS. See if the menu item mentioned below is there. If so, try to make a sample app - maybe this "Android SDK" step is no longer needed - the Workload might set everything up.
Then Android Device Manager will be at menu Tools / Android / Android Device Manager.
QUESTION
I found and tried one example of a custom rendered DatePicker, for Android, for Xamarin Forms and does not show which button was clicked in UnFocus. At least not for me. Its from stackoverflow. Xamarin.Forms Android DatePicker/TimePicker button listener
Has the example in this article helped anyone else? I really need to know when the OK button is clicked.
...ANSWER
Answered 2021-Dec-13 at 23:41This extends Nick Kovalsky's answer. I also fixed a bug in that answer, that meant the renderer was never used.
Subclass DatePicker, so that you can add a new BindableProperty and a new method. Place this in your cross-platform project.
OKCancelDatePicker.cs:
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