-
Notifications
You must be signed in to change notification settings - Fork 37
Home
You call the static XamUInfrastructure.Init method to do the common initialization tasks. This should only be called once. It registers each of the built-in implementations with the defined abstractions:
-
FormsNavigationPageService=>INavigationService -
FormsMessageVisualizerService=>IMessageVisualizerService -
DependencyServiceWrapper=>IDependencyService
You can also replace the IDependencyService default by passing in a different implementation to the XamUInfrastructure.Init method. This method always returns the decided IDependencyService which you can cache off and use in your app, or retrieve from anywhere in your code through the static XamUInfrastructure.ServiceLocator property.
If you want to replace the other services, then just add them to the returned dependency service and they will replace the original registrations.
See XamUInfrastructure for more details.
This is a list of the reusable classes included in the library. Most are independent and have not required dependencies on each other so you can pick and choose what you utilize in your code. For example you can choose to use the message visualizer service but not the navigation service.
XamUInfrastructure - static class to initialize and retrieve the service locator.
- NavigationCommands - a static class which exposes static properties of the navigation commands.
-
NavigationBackCommand - an
ICommandwhich performs aNavigationService.GoBackAsync. -
NavigationToCommand - an
ICommandwhich performs aNavigationService.NavigateAsync.
-
NamedDataTemplateSelector - a
DataTemplateSelectorwhich uses the context type name to locate visual data templates.
- EventToCommandBehavior - used to handle a .NET event as a Command.
-
PickerBindBehavior - used to data bind a
Pickerto a set of properties in a ViewModel. -
NumericValidationBehavior - restricts an
Entryto only support numeric values. -
EffectBehavior - adds an
Effectto a control.
-
ItemsControl - a simple bindable template creator which will instantiate a set of
Labelelements orDataTemplatedriven elements from a bound list. Similar to aListView, but the produced content is not scrollable, nor does it provide any interactivity outside the generate content.
-
DebugConverter - a value converter which outputs the
ConvertandConvertBackto the debug console. -
EventArgsConverter - a value converter for the EventToCommandBehavior class which can pull out a single public property or field to pass to the
ICommand. - IntegerToBooleanConverter - a value converter which converts an integer value into a boolean.
- NotBooleanConverter - a value converter which flips the value of a boolean.
- NullOrEmptyBooleanConverter - a value converter which takes an object/string and turns it into a boolean.
- ImageResourceConverter - a value converter to load an ImageSource from embedded resources so you can data bind an Image from a ViewModel.
-
GroupedObservableCollection - used to hold observable grouped collections for
ListView. -
ObservableDictionary - a
Dictionarywhich supports change notifications for bindings. -
OptimizedObservableCollection - an
ObservableCollectionwhich lets you disable change notifications for a brief period for mass updates. -
RefreshingCollection - an
ObservableCollectionwhich supports asynchronous refreshing behavior.
-
CollectionExtensions - a set of extension methods for collection/
IEnumerabletypes. -
ElementExtensions - extension methods for Xamarin.Forms
Elementtypes. -
ExceptionExtensions - extension methods for processing
Exceptiontypes. -
TaskExtensions - extension methods for
Task.
-
IAsyncDelegateCommand - an interface to expose
ExecuteAsync. Derives fromIDelegateCommand. -
IDelegateCommand - an interface to expose
RaiseCanExecuteChanged. This derives fromICommand. -
IDependencyService - an abstraction over a typical Service Locator such as Xamarin.Forms
DependencyService. -
IMessageVisualizerService - an abstraction over a "MessageBox" display such as Xamarin.Forms
Page.DisplayAlert. - INavigationService - an abstraction for a basic navigation service using string-based keys to represent the pages you can navigate to.
- IViewModelNavigationInit - an interface to provide async initialization to view models, and to pass parameters in as part of navigation.
-
DependencyServiceExtension - a XAML extension to use
DependencyService.Get<T>to fill in a property value. -
ImageResourceExtension - a XAML extension to retrieve an
ImageSourcefrom embedded resources. -
RelativeBindingContext - simpler way to capture
BindingContextfrom one element to another.
-
AsyncDelegateCommand - an implementation of
IAsyncDelegateCommand. -
DelegateCommand - an implementation of
IDelegateCommand. Useful to avoid dependencies in your ViewModels on Xamarin.Forms. -
PropertyObserver - a fluid property observer which lets you easily monitor
PropertyChangenotifications on child ViewModels. - SimpleViewModel - a base ViewModel implementation for MVVM which supports property change notifications.
You can create and pass parameters to View Models in several ways.
-
DependencyServiceWrapper - a wrapper around Xamarin.Forms static
DependencyServiceclass to turn it into a service based onIDependencyService. -
FormsMessageVisualizerService - a wrapper around Xamarin.Forms
Page.DisplayAlertmethod to turn it into a service based onIMessageVisualizerService. -
FormsNavigationPageService - an example service which implements the included
INavigationServiceand supports basic stack-based navigation through Xamarin.Forms.