At the heart of Crosslight is the Foundation layer which contains the base frameworks, components, services, messaging and application infrastructure. The Crosslight Foundation is built on platform-neutral .NET stack (Portable Library) enabling Crosslight to target as many .NET platforms as possible – iOS, Android, Windows Phone, and Windows Store – with the same set of Foundation assemblies.
public class SimpleListViewModel : ListViewModelBase<item>
{
public SimpleListViewModel()
{
this.Items = this.Repository.GetAll().ToObservable();
}
public string TotalItemsText
{
get
{
if (this.Items.Count() == 0)
return "No items.";
else if (this.Items.Count() == 1)
return "1 item";
else
return this.Items.Count() + " items";
}
}
}
Crosslight Foundation brings two-way data binding capabilities to non-MVVM platforms such as iOS and Android. As the result, Crosslight makes cross-platform mobile development a reality by leveraging loosely-coupled design pattern that facilitates clear separation between user interaction logic and the view-specific technology – ultimately maximizes code reuse.
The Crosslight binding framework supports all binding mode such as one-time, one-way and two-way binding. It supports converter, converter parameter, string format, culture, as well as explicit and real-time update source trigger mode. More importantly, the binding framework performs nearly 2x faster than Microsoft’s .NET implementation.
In addition, the Crosslight Foundation also includes many components to support MVVM development such as a high-performance IoC (Inversion-of-control) container, lightweight delegate command, memory-efficient event aggregator and thoughtfully-engineered application lifecycle infrastructure that executes reliably across all platforms.
MVVM & Binding
Form Builder
View Presenters
Mobile Services
Enterprise Framework
Data Access
Two-way Data Sync
Advanced SQLite
Push Notification
Social Network
Async Image Loader
100,000+ API
[FormMetadataType(typeof(Item.FormMetadata))]
partial class Item
{
[Form(Title = "{FormState} Item")]
public class FormMetadata
{
[Section(Style = SectionLayoutStyle.ImageWithFields)]
public static GeneralSection General;
[Section("Item Details")]
[VisibilityBinding(Path = "IsSold")]
public static ItemDetailSection ItemDetail;
[Section("Item Status")]
[VisibilityBinding(Path = "IsNewItem", SourceType = BindingSourceType.ViewModel,
ConverterType=typeof(BooleanNegateConverter))]
public static SoldSection Sold;
[Section]
public static NotesSection Notes;
}
public class GeneralSection
{
[Editor(EditorType.Image)]
[Image(Height = 83, Width = 80, Placeholder = "item_placeholder.png", Frame = "frame.png", FramePadding = 6,
FrameShadowHeight = 3)]
[ImagePicker(ImageResultMode = ImageResultMode.Both, ActivateCommand = "ActivateImagePickerCommand",
PickerResultCommand = "FinishImagePickerCommand")]
public static byte[] ThumbnailImage;
[StringInput(Placeholder = "Product name")]
[Layout(Style = LayoutStyle.DetailOnly)]
public static string Name;
[StringInput(Placeholder = "Price")]
[Layout(Style = LayoutStyle.DetailOnly)]
public static decimal Price;
}
public class ItemDetailSection
{
[Editor(EditorType.TextView)]
[StringInput(Placeholder = "iPad 4 Mini, 64GB", MaxHeight = 68f, AutoResize = true)]
public static string Description;
[StringInput(Placeholder = "Living Room", AutoCorrection = AutoCorrectionType.No)]
public static string Location;
...
}
...
}
Includes over 20 common editor types – ranging from textbox, multi-line textbox, checkbox, switch to date time picker and selection controls. In addition, it also ships with a comprehensive set of metadata that enables you to intuitively define the behaviors of a certain editor type.
The form builder service includes various pre-built layout design so you can create amazing data form like a pro. Choose from basic detail on the right, detail on left, detail on bottom, or detail only layout. It also includes a special composite image and fields layout which is ideal for contact or user details form.
The form builder automates data binding process and takes care every little detail of the user experience aspects – from rotation handling, phone and tablet support, showing and dismissing popups to data processing and image optimization such as full size image and thumbnail image generation.
With Crosslight Foundation, you don’t have to deal with platform-specific code just to present a simple message box or an activity indicator. Choose from five types of presenters that you can call with just a single API – message presenter, toast presenter, action presenter, activity presenter and action toast presenter. All presenters are intuitively designed to allow you easily configure their behaviors through the provided parameters and settings.
Crosslight Foundation includes pre-built core services enabling you to easily access mobile-related functions such as telephony services for making call and composing short message, location services for getting current location and detecting location changes, camera services for capturing photo or video, browser, map, and more. And best of all, you can consume all these mobile services right from the ViewModel.
Building full-featured business apps is no longer rocket science – thanks to the advanced Crosslight enterprise app framework. Built upon Crosslight's solid foundation, the app framework includes a multitude of great features designed for business apps such as remote data management, identity management, integration with social networks, authentication, push notifications and much more. More importantly, it is designed with modern design patterns that emphasize clear separation between domain model, data access, and entity services.
Crosslight made data access a breeze with its new, powerful data access services. Optimized for performance, the RestClient lets you easily fetch data from any REST-enabled services. Data modifications such as insert, update and delete are supported as well. It also supports dynamic queries for sorting, filtering and paging capabilities with developer-friendly API.
Modern cross-platform apps today heavily rely on data synchronization to allow users to work online — or offline. Thankfully, Crosslight includes a proven, high-performance data synchronization service that was built on our decades of experiences building enterprise apps. It provides an end-to-end sync framework including both client and server.
Crosslight makes it easy for you to implement offline data storage in your apps – thanks to the robust SQLite services. Unlike other SQLite implementation, Crosslight SQLite is built from the ground up with modern design patterns to support advanced features such as asynchronous API, LINQ, and automatic changes and version management.
Crosslight includes a universal cross-platform push notification services that lets you implement push notifications in just a few lines of code, shaving months off your time table. The universal push services comes with both client and server side components. All you need to do is to configure the settings and register the services – no tedious platform-specific knowledge is required.
Built from the ground up, Crosslight's social network services provides direct access to the world's most popular social networks such as Facebook and Twitter without dependencies to third-party SDK — all accessible right from the ViewModel. Key features include automatic sign-in with existing native accounts, authenticate with user interface with web fallback, posting feeds, and getting friends list.
Designed with versatile screen virtualization, the Crosslight’s image loader works perfectly with view components that support items virtualization such as table view in iOS, Android and Windows. Other key features include smart URI detection, automatic image caching on successful download, smart cache expiration detection, auto retry download on weak connection and more.
And that’s not all! Crosslight Foundation ships with more than hundreds of thousand APIs that you can readily use to build the most demanding cross-platform business apps. It covers every API for real-world apps development such as local storage management, identity and user management, authentication and cryptography, resource loader and cache management, data serialization and much more.