A lot of times when developing your applications, you are required to create a kind of popup as a message box or confirmation dialog. The best plugin I have seen and used over time is the Rg.Plugins.Popup.

This plugin is a cross platform plugin that allows you to open pages as popup in your Android, iOS and UWP projects.

Before you can use this plugin, you have to do some initialization in each platform you are targeting. This initialization must come before the initialization of Xamarin.Forms.

To see how to implement this plugin, click here.

There are basic and essential implementations that are required for your application to work seamlessly such as checking for connectivity, getting device information, geolocation and lots more.

The folks at Microsoft have made all these possible in a single plugin called Xamarin Essentials. You get this plugin by default every time you create a new project.

For example, see how easy it is to get geolocation from the device with few lines of code. The only extra step is to set the permission required for the features you are implementing.

var location = await Geolocation.GetLastKnownLocationAsync();
if (location != null)
Console.WriteLine($"Latitude: {location.Latitude}, Longitude: {location.Longitude}, Altitude: {location.Altitude}");
catch (Exception ex)
// Unable to get location
view rawgeolocation.cs hosted with ❤ by GitHub

To see how implement geolocation and use it with a map, click here.

The Model-View-ViewModel (MVVM) pattern helps to cleanly separate the business and presentation logic of an application from its user interface (UI).

Maintaining a clean separation between application logic and the UI helps to address numerous development issues and sometimes implementing this pattern can prove difficult and mundane for both new and experience developers.

MVVM Helpers make the implementation of MVVM pattern easy and less time consuming so that you can focus more on the business logic.

An example of the helper I commonly use is the is the SetPropery & GetProperty helpers which takes away the stress of implementing INotifyPropertyChanged.

Check out this video here detailing how to implement MVVM Helpers.

FFImageLoading is a cross platform image library for loading images quickly and easily. It supports image file formats such as GIF, SVG and WebP.

One interesting feature of this plugin is caching. If you have multiple image controls that are using the same image source, the plugin will load the source image once and use the cached version for the rest thereby reducing data consumption of the app.

You can perform some fade-in animations with your images and also apply transformations such as crop, blur, grayscale, round corner, flip and rotation.

Often times you need to integrate monetization into your mobile apps in order to generate revenue. This is usually by introducing in-app purchases in form of remove ads feature, buying in-game currency or upgrading to the Pro version of the app.

The In-App Billing Plugin supports three types of in-app purchase. Consumables, Non-Consumables and Subscriptions.
 Consumables can be described as any one-time service within the app. For example, in-game currency or extra health.
• Non-Consumables are items that can only be purchased once such as removing ads, books, game levels, and additional app functionality
• Subscriptions are auto-renewable payments which can be monthly or yearly and non-renewable subscription that expires after a set amount of time.

App Center contains a lot of features to help you with your mobile app development. The two major features I have used over the years are App Center Crashes and App Center Analytics.

App Center Crashes will automatically generate a crash log every time your app crashes. Collecting crashes work for apps in beta and live apps.

To implement crash reporting and analytics, you need app secrets which you can get by registering on App Center Website. Note that if you are targeting more than one platform, you will need to create the application for each platform to get app secrets for each platform.

In order to use App Center Plugin, you have to install the plugin into your projects and then proceed to your App.xaml.cs to initialize the plugin by supplying the app secret for each platform.
You can start tracking errors like this within your code.

Monkey Cache provides easy ways to cache any data structure for a specific amount of time. For example, you are making a web request and you get some response back from the server, you want the ability to cache this data in case you go offline, but also you need it to expire after a certain number of minutes or hours. Monkey Cache provides you with these capabilities.

To set up Monkey Cache, first, select an implementation of Monkey Cache that you would like (LiteDB, SQLite, or FileStore). Install the specific NuGet for that implementation, which will also install the base MonkeyCache library.

You will require to set a custom Application ID for your application so that the Cache engine can uniquely identify your application.

Media content is the future of content and there is a need to put this into consideration when developing mobile applications.

MediaManager Plugin is a cross platform Xamarin plugin that simplifies access to the device’s native media functions and make it easy for your user to interact with audio and video in your mobile apps.

The features include native playback of media files from both local and remote sources, notifications, media controls and playback status. It also allows you to add multiple media items for sequential playback.

This plugin requires initialization in each of the platform you are targeting.

Lottie is a cross platform library, which allows you to run animations within your applications.

These animations are defined in a JSON file containing all the details of colors, shapes and transforms. You need Adobe After Effects in order to create these JSON files, however, there are lots of free lottie animation out there that are shared by designers.

To get started, first install the Nuget package to your projects and then initialize it in your respective projects. In order to show an animation, you need to put the After Effects JSON file in your Assets (Android) or Resources (iOS) folder and then load it into the animation view.

App designs usually contain views with gradients, borders, rounded corners and shadows. Developers implementing these designs in Xamarin Forms require layouts that support these specifications.

Pancake View is a plugin that supports gradients, borders, rounded corners and shadows. Implementing Pancake View is very simple and straightforward. First, install the plugin in your projects and then tell your XAML page where it can find the Pancake View by adding the namespace to your XAML code.

You can now call the Pancake View Control and add properties the suits the design you are working with.

Animation has a way of spicing up the user experience of your mobile application. Micro-interactions, transitions, and in-app animations are usually used to explain the logic of an app to a user and improve the overall app usability.

Shared Transition Plugin allows you to implement shared element transitions by connecting common elements from one page to another. A shared element transition determines how elements that are present in two pages transition between them.

Your application may require the use of file from the user’s device for viewing, editing and other file operations.

File Picker Plugin is a simple cross platform plugin that allows you to pick files and work with them. You can select any file type or set the allowed type in order to limit the files that can be selected.

Fingerprint authentication provide applications with an alternative to the conventional username and password method used for user authentication and makes it possible for your application to implement security that is less intrusive.

A fingerprint must already be enrolled with the device for the user to be authenticated successfully.

Xamarin Fingerprint Plugin is a cross platform plugin that allows you to authenticate users with the enrolled fingerprint on their devices. To start using the plugin, you must initialize and request the necessary permissions in all the platforms you are targeting.

Chart in mobile applications is a great way to present a clear overview of numerical data and show the relationship of such data. Microcharts is a selection of common charts that are easy to use, visually pleasing, and provides ready-to-use charts in your Xamarin Forms Applications.

There is a wide range of charts included in Microcharts Plugin for you to choose from such as the Bar Chart, Pie Chart, Line Chart, Point Chart and others. You can select the chart that best fit your data within your application.

Has there ever been a need to display mathematical formulae in your application but cannot find any tool to help you? CSharp Math is what you are looking for. This is a library that allows you to display mathematical expressions within your mobile applications.

It makes use of LaTeX engine to convert plain text into high-quality mathematical expression for display on your mobile app screen.

It works perfectly in both XAML and C# code.

Many apps require special controls that are not part of the native kit and to achieve this, there is a need to render 2D graphics directly and natively on the app.

SkiaSharp is a cross platform library that allows to directly draw on the UI canvas and makes it possible to create complete custom controls. It is a 2D graphics library that provides a rich API to basically draw fancy things on the UI canvas.

Questions of the Day.
1. What other nuget packages do you use that are not mentioned? Let me know in the comments below.
2. Which of these nuget package would you like me to implement in a future video? Let me know in the comments below.

출처 : https://devcrux.com/blog/15-nuget-packages-for-xamarin-forms-and-net/

iOS 프로젝트를 정리하고 재 빌드하면 된다. 끝.

도대체 왜 이런건지 알수가 없네..;;

윈도우에서 작업하던 소스를 갑사에서 mac 에서 소스를 열어서 테스트 하는데
이미지 탭한 경우 이벤트 발생이 안되는 현상 발생되었다

일단 결론부터 말하면 원인은 4월2일 xCode 11.4 로 업데이트 되었는데 
이전에 배포되었던 Xamarin.iOS 13.16 버전이 문제가 있어 이미지 탭한 경우 
탭 이벤트가 발생안되는 현상이었다.

[아래 링크 참고 (모든 탭 이벤트 먹통됨)]

언제인지 모르겠으나 이후 MS 에서 문제점을 알고 버그 픽스 버전을 출시예정이라고 한다.
(현시점 2주안에 해결해 준다고 하는데.....)

Xamarin.iOS 이전 버전을 설치하여 해결가능하다고 하여 아래링크의 pkg 를 받아 설치해보았다.

설치하고 정상동작 되는 걸 확인.

윈도우에서 개발을 하여 테스트를 하고 있었는데 
윈도우에서 비쥬얼 스튜디오를 이용해 작업하는경우 mac 연결 시
자동으로 Xamain.iOS 버전을 을 설치했었는데 그땐 에뮬 동작이 제대로 동작된다.;
하지만 iOS 에서 솔루션 열면 또 안되는.. 머 이런 .

하필 갑한테 보여주는날.. ㅜㅠ

이전버전으로 돌리거나 
좀 기다렸다가 최신으로 업데이트 받으면 된다.

* 추가

mac 에서는 preview 버전 13.18 을 설치하면 정상 동작 된다고 한다.

아래는 주문 이력 화면 예시로 

CollectionView 에서 Header 가 있는 경우 처리하는 방법입니다.

                EmptyView="주문이력이 없습니다."
                SelectionChanged="OnCollectionViewSelectionChanged" >
                            <ColumnDefinition Width="90" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="70" />
                            <ColumnDefinition Width="70" />
                        <Label Grid.Column="0" Text="주문일자" TextColor="Black" FontSize="15" VerticalTextAlignment="Center" HorizontalTextAlignment="Center"/>
                        <Label Grid.Column="1" Text="주문매장" TextColor="Black" FontSize="15" VerticalTextAlignment="Center" HorizontalTextAlignment="Center"/>
                        <Label Grid.Column="2" Text="주문상태" TextColor="Black" FontSize="15" VerticalTextAlignment="Center" HorizontalTextAlignment="Center"/>
                        <Label Grid.Column="3" Text="주문가격" TextColor="Black" FontSize="15" VerticalTextAlignment="Center" HorizontalTextAlignment="End"/>
                    <BoxView HeightRequest="1" HorizontalOptions="FillAndExpand" Color="Black"/>
                    <Grid Margin="0,10,0,0">
                            <ColumnDefinition Width="90" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="70" />
                            <ColumnDefinition Width="70" />
                        <Label Grid.Column="0" Text="{Binding ORDER_DATE}" TextColor="Black" FontSize="12" VerticalTextAlignment="Center" HorizontalTextAlignment="Center"/>
                        <Label Grid.Column="1" Text="{Binding STORE_NAME}" TextColor="Black" FontSize="13" VerticalTextAlignment="Center" HorizontalTextAlignment="Center"/>
                        <Label Grid.Column="2" Text="{Binding ORDER_STATUS}" TextColor="Black" FontSize="12" VerticalTextAlignment="Center" HorizontalTextAlignment="Center"/>
                        <Label Grid.Column="3" Text="{Binding PRICE, StringFormat='{0:N0}'}" TextColor="#B32026" FontSize="15" VerticalTextAlignment="Center" HorizontalTextAlignment="End"/>

* EmptyView 는 항목이 없는 경우 중간에 Text 로 표시가 필요할 때 사용한다.

위 내용을 데이터를 체우면 아래 처럼 표시 된다.




애플 개발자 계정에 아이폰 기기를 등록하는 과정을 설명합니다.

1. 앱개발자 사이트 접속 (https://developer.apple.com/account/#/welcome) 하여 Certificates, Identifiers & Profiles 선택

2. 죄측메뉴 중 Devices 메뉴 선택후 우측의 파란바탕의 + 버튼 클릭

3. Device Name 을 입력하고 DeviceID(UDID) 입력

UDID 확인은 iTune 를 연결하여 확인하거나 아래 작성글을 참고해서 폰에서도 확인 가능


4. Register 버튼을 클릭

5. Done 버튼 클릭하여 등록 완료

* 여기 까지만 하면 맥과 폰을 연결해도 비쥬얼 스튜디오에서 목록이 나타나지 않는다.

6. 맥과 폰을 연결하여 iTune 를 실행하여 아래처럼 화면이 뜨면 신뢰 클릭 (폰에서도 신뢰 선택)

7. 비쥬얼 스튜디오에서 기기 목록이 뜨는지 확인

NavigationPage.SetHasNavigationBar(this, false);

NavigationPage  를 쓰면서 메인 페이지에서 백버튼 눌렀을 경우

DisplayAlert (종료확인창)을 띄우는 방법은 아래와 같다.

        protected override bool OnBackButtonPressed() 
            if (Navigation.NavigationStack.LastOrDefault() == null)
                Device.BeginInvokeOnMainThread(new Action(async () =>
                    if (await DisplayAlert("종료확인", "종료하시겠습니까?", "네", "아니오"))

            return true; 

Navigation.NavigationStack 을 확인하여 메인 페이지 인지 확인한 후 Device.BeginInvokeOnMainThread 를 이용하여 await DisplayAlert 를 이용해 팝업 창을 띄우고 종료한다.

Grid 에서 특정 Row 를 숨기는 방법

using System;
using System.Globalization;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace Foobar.Converters

    public class StatusToVisibilityConverter : IValueConverter
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
            if (Equals(value,null))
                return new GridLength(0);

            var status = value.ToString().ToLower();

            switch (status)
                case ("active"):
                        return new GridLength(1, GridUnitType.Auto);
                        return new GridLength(0);
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
            throw new NotSupportedException("Only one way bindings are supported with this converter");
<Grid AbsoluteLayout.LayoutFlags="All"
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
        <RowDefinition Height="{Binding Contact.Status, Converter={convert:StatusToVisibilityConverter}}" />

              <ShellContent  Title="test" >

위 내용을 코드로 변환하면 아래와 같습니다.

            ShellContent shellContent = new ShellContent();
            shellContent.Title = "test";
            var template = new DataTemplate(typeof(TestPage)); // 인자 없을때
            var template new DataTemplate(() => { return new TestPage("test"); }); // 인자 있을때
            shellContent.ContentTemplate = data;

ShellContent 를 동적으로 생성하면서 인자를 던지고자 할때 사용하면 유용합니다.^^





android 의 AndroidManifest.xml 쪽에 android:usesCleartextTraffic="true" 항목을 추가해주면 된다.

+ Recent posts