Xamarin.Forms MVVM DataTemplate with IndicatorView
Xamarin how-to
by Toby Field
2y ago
This Xamarin how-to article shows (in my opinion) the easiest and cleanest way to implement the MVVM pattern in a DataTemplate.  The example I will be using is a ‘set up wizard’ using a standard Xamarin.Forms CarouselView and IndicatorView.  The example show how you can keep each ‘page’ in the setup wizard separate with a separate view model also even though they are all contained within the same navigation page. The Main XAML Page This is the simple XAML page code that will hold all of our individual pages/templates within a CaraouselView with indicator dots on the bottom of the ..read more
Visit website
Xamarin.Forms CollectionView Alternating Row Colors
Xamarin how-to
by Toby Field
2y ago
Very quick Xamarin How-To this week with a simple converter. Alternating row colours in a CollectionView is quite often a design requirement and I wanted to create a simple, reusable converter to solve this. The Converter using System; using System.Globalization; using System.Linq; using Xamarin.Forms; namespace XhtCollectionViewAlternatingRowColor.Converters { public class IndexToColorConverter : IValueConverter { public Color EvenColor { get; set; } public Color OddColor { get; set; } public object Convert(object value, Type targetType, object parameter ..read more
Visit website
Xamarin.Forms Maps – Getting Location & Radius of User’s Input
Xamarin how-to
by Toby Field
2y ago
Recently I have had to navigate through Xamarin.Forms Maps for a project.  After some documentation reading I found that XF Maps does not offer a lot of the customisation and functionality of the native map libraries (MapKit and Google Maps).  This left me having to write some custom renderers to complete the project’s requirements. In this Xamarin how-to post, I will show you how to obtain the latitude, longitude and radius from the center of the map every time the user moves or zooms.  This is especially useful if you have dynamically updating pins.  Instead of bloatin ..read more
Visit website
Xamarin.Forms lightweight bottom sheet modal
Xamarin how-to
by Toby Field
3y ago
Bottom sheets are becoming increasingly more popular in modern apps including Facebook, Instagram and Microsoft Teams.  A bottom sheet comes in three main forms including: Standard – the sheet remains visible while users can interact with the rest of the content on the screen. Modal – the sheet must be dismissed to interact with the rest of the content on the screen. Expanding – the sheet is able to be resized with ‘snap’ points often a low, middle and fullscreen view.  The underlying content is also able to be interacted with by the user. In this Xamarin how-to post, I will sho ..read more
Visit website
Keeping your UI fast by using this HTTP trick to check if a remote resource exists
Xamarin how-to
by Matt Crombie
3y ago
Frequently I find a requirement in mobile projects is to consume remote resources, whether it’s images, video, audio etc, the requirement comes up fairly frequently. A common problem I found myself hitting was that when you’re trying to do this with a backend or customisable content that relies on a URL is that sometimes the resource doesn’t exist. This can be because it’s been removed, a typo means it can’t find it or something else. Mobile network connections are extremly varied from bad underground connections to speedy 5G connections. Being able to handle this can make the difference bet ..read more
Visit website
Migrating to Android X: Another Attempt
Xamarin how-to
by Toby Field
3y ago
Due to the expanding number of packages that require Android X (namely Xamarin.Forms 5) it is essential that you can get an old project compiling and running on Android X.  This can come as quite a challenge especially to massive projects that are quite old.  Anyone who has tried to use the built in visual studio “Migrate to Android X” feature has probably realised that it doesn’t always work and you’ll run into compilation errors. If you’re lucky visual studio will simply ask you to install an Xamarin.AndroidX nuget package as shown below. However, you’re most likely going to ..read more
Visit website
Xamarin.iOS April 2021 bug: System.EntryPointNotFoundException: xamarin_timezone_get_data
Xamarin how-to
by Matt Crombie
3y ago
Having been successfully developing a recent feature a project, I came across an issue suddenly with Xamarin.iOS builds that had gone out to the client. All of a sudden the apps were crashing immediately on startup. Running the same configuration up locally, everything was working fine. When I ran the code on a device however I discovered the issue that was being spat out through the AppDelegate start up process: DEBUG: System.EntryPointNotFoundException: xamarin_timezone_get_data at System.TimeZoneInfo.GetMonoTouchData (System.String name, System.Boolean throw_on_error) [0x00002] in /Library ..read more
Visit website
5 day-to-day C# extension methods to make your life easier
Xamarin how-to
by Matt Crombie
3y ago
I’ve noticed recently I take for granted some extensions methods I’ve been using for a while now that I use on a fairly frequent basis. From getting a file as base64 quickly to to just doing simple JSON operations, here are 5 day to day extension methods that hopefully prove helpful to your projects. Feel free to look at the examples below or if you simply want to use the methods, they’re all contained in the following NuGet package (along with A LOT more but I haven’t had time to properly document the whole toolkit yet so that’s for another day, and yes it will be open sourced when it’s pro ..read more
Visit website
Fixing small text on iOS WKWebView’s in Xamarin.Forms
Xamarin how-to
by Matt Crombie
3y ago
Even though Apple have extended the deadline to remove UIWebView’s from apps until December, the requirement to update things is still there and I’m finding a lot of clients wanting to get ahead of things and move on. On several apps I work with there is HTML content within the app that’s maintained by non-technical people via various backend services and CRM’s. When entering text that they expect to look like all other text in the app, the WKWebView is displaying it in an extremely small size that is almost unreadable on devices. Now I don’t know about everyone else but I’ve very rarely work ..read more
Visit website
Automate iOS TestFlight step “Missing export compliance” for every build
Xamarin how-to
by Matt Crombie
3y ago
Distributing a lot of test versions of apps comes with the territory of being an app developer. There’s no way around it. Whilst Microsoft App Center has made cross-platform distribution pretty straight forward and painless, there are times when the individual platform methods come in to play. One thing I do is run a nightly “production” build pipeline that submits apps to App Store Connect for Apple/iOS and Google Play for Android so that the technical checks done by each platform are done regularly. This also means I can get a version as close to the release candidate as possible out to tes ..read more
Visit website

Follow Xamarin how-to on FeedSpot

Continue with Google
Continue with Apple
OR