DialogMessaging 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package DialogMessaging --version 0.1.0                
NuGet\Install-Package DialogMessaging -Version 0.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DialogMessaging" Version="0.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DialogMessaging --version 0.1.0                
#r "nuget: DialogMessaging, 0.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DialogMessaging as a Cake Addin
#addin nuget:?package=DialogMessaging&version=0.1.0

// Install DialogMessaging as a Cake Tool
#tool nuget:?package=DialogMessaging&version=0.1.0                

<div align="center">

GitHub license

</div>

DialogMessaging

Inspired by Acr.UserDialogs, DialogMessaging is a cross platform, customizable dialog messaging service.

Dialogs

  • Alert*
  • Confirm*
  • Delete*
  • Loading*
  • Action sheet*
  • Action sheet bottom*
  • Login *
  • Prompt*
  • Toast
  • Snackbar

*Synchronous and asynchronous methods are available.

Getting Started (MvvmCross)

Add a reference to DialogMessaging.Core and DialogMessaging.MvvmCross. At the entry point for your app call DialogMessaging.MessagingService.Init().

Additional Steps for Android

Inside the Init method you must provide an Activity or Application reference.

Add the following to the BindView method of your MvxAndroidViewBinder:

public override void BindView(View view, Context context, IAttributeSet attrs)
{
    ...
    
    MessagingService.OnViewInflated(view, attrs);
}

See Setup and ViewBinder.

Getting Started (non-MvvmCross)

DialogMessaging relies on ViewPump. Add a reference to the project and see the GitHub page for getting started. You should initialize the ViewPump service before StylingX to allow StylingX to register with ViewPump.

Add a reference to DialogMessaging.Core and DialogMessaging. At the entry point for your app call DialogMessaging.MessagingService.Init().

Additional Steps for Android

Inside the Init method you must provide an Activity or Application reference.

Customization

You can access and set a custom IMessagingDelegate via DialogMessaging.MessagingService.Delegate. These delegate methods are called by their respective display methods and allow you to customize the display process. By returning true or false you can optionally cancel dialogs from being shown. If you set a custom IMessagingService you are responsible for calling and handling delegate methods.

Android

You can set layout and style ID's on a dialog-by-dialog basis or you can assign default values. If no customization is provided the normal Android AlertDialog's and internal layouts will be used.

// Defaults.
IAlertConfig.DefaultLayoutID = Resource.Layout.MyCustomLayout;
IAlertConfig.DefaultStyleID = Resource.Style.MyAppTheme;

// Individual dialog.
var alertConfig = new AlertConfig
{
    LayoutID = Resource.Layout.MyCustomLayout,
    StyleID = Resource.Style.MyAppTheme
};

In your custom layouts, assign dialog elements using the app:DialogElement tag. Any part of the layout that uses this tag will be hidden if the corresponding data inside of the configuration holds no value. For example: if Title within the configuration object is null or empty any layout element that uses app:DialogElement="Title" will be hidden. This can be customised using the app:HideWhenNotInUse tag which by default is set to true.

See DialogElement for all usable dialog element values. Be aware that not all are available for every dialog. For example: ProgressDeterminate isn't available when using Alert.

iOS

You can set view types on a dialog-by-dialog basis or you can assign default values. If no customization is provided the normal iOS UIAlertController's and internal views will be used.

// Defaults.
IAlertConfig.DefaultViewType = typeof(CustomAlertView);

// Individual dialog.
var alertConfig = new AlertConfig
{
    ViewType = typeof(CustomAlertView)
};

Your custom views must implement IShowable which gives you the Show and Dismiss methods. This is where you control the presentation of your view such as animations. You should not interact with the view hierarchy as this is done for you. You can optionally assign DialogViewAttribute to your view class if the view has an associated XIB/NIB file. To assign configuration values to your view, implement IValueAssigner.

Samples

See samples for examples.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed.  monoandroid10.0 is compatible. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed.  xamarinios10 is compatible. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.3-alpha-e8f2459-e8f2459 180 2/1/2022
1.0.3-alpha-6 170 2/1/2022
1.0.3-alpha-5 150 2/1/2022
1.0.2 494 1/12/2022
1.0.2-alpha-e8f2459-e8f2459 174 2/1/2022
1.0.2-alpha-19a32ce-19a32ce 154 1/28/2022
1.0.2-alpha-0c45202-0c45202 162 2/1/2022
1.0.1 341 10/15/2021
1.0.0 332 9/7/2021
0.99.23-alpha-75c849d 206 8/23/2021
0.99.22-Cdd7d7b9 191 7/14/2021
0.99.21-working-4c6285b 210 7/13/2021
0.99.20-C07546ac 208 7/9/2021
0.99.19-C0f0acc3 166 7/9/2021
0.99.17-alpha 183 7/2/2021
0.99.16-alpha 207 7/2/2021
0.99.15-alpha 230 6/25/2021
0.99.14-alpha 223 6/21/2021
0.99.13-alpha 207 6/15/2021
0.99.12-alpha 221 6/7/2021
0.99.11-alpha 219 6/7/2021
0.99.10-alpha 195 6/7/2021
0.99.9-alpha 237 6/4/2021
0.99.8-alpha 187 5/20/2021
0.99.7-alpha 203 5/10/2021
0.99.6-alpha 209 5/8/2021
0.99.5-alpha 244 5/7/2021
0.99.4-alpha 228 5/7/2021
0.99.3-alpha 205 4/30/2021
0.1.0 377 3/4/2021