1 rating
  • 1
  • 2
  • 3
  • 4
  • 5
5 star 1
4 star 0
3 star 0
2 star 0
1 star 0
Compatible with
  • Android
  • iOS

Crosslight Logging Service 4.0.000.1

Intersoft Solutions Corp.

A logging service component extension for Crosslight.

About this Component

Crosslight Logging Service

As a part of the Crosslight 4 release, Crosslight Logging Service is a service extension of the Crosslight component which provides mobile enterprise logging capabilities to Crosslight applications. This component supports Crosslight.iOS, Crosslight.Android, Crosslight.WinPhone and Crosslight.WinStore applications.

Powerful and comprehensive logging is an invaluable part of an enterprise app. It allows you to perform data mining, gather information how users use your apps, and analyze errors and crashes of your app. While you can simply performing debug to obtain a particular information in development environment, often, it is not possible to do so when the app is already in production – live at the store. This is where a powerful logging framework comes to rescue. In this release, Crosslight introduces a highly versatile and extensible logging framework, enabling you to easily implement application logging with relatively minimum amount of code.

Crosslight makes logging painless – thanks to the intuitive, developer-friendly API. The Crosslight logging interface is modeled upon popular logging concept which favor simple logging API with predefined naming conventions. This means that you don't need to concern the actual implementation of the logging, all you need to do is accessing the Logger property available in your ViewModel class, then simply write your logs accordingly such as calling the Info method for logging informational message or Error method for logging an exception. See the code example below.

    this.Logger.Error("Error when saving", exception);
    this.Logger.Info("Saving {0}", items.Count());

Automatic Integration to Azure Application Insights

Crosslight Logging Service

With just simple configuration, Crosslight apps can now be analyzed right from Azure Application Insights, thanks to the extensible nature of the Crosslight's logging service. Crosslight 4 ships with logging component extension designed for Azure Application Insights, enabling you to gather various useful information, such as ensuring the application's availability for your users, diagnose exceptions and performance issues, analyze your application's usage, and more.

Learn more about Crosslight Logging Service here.

How to use this Component

Please follow the steps as outlined in Intersoft Developer Center: Implementing Application Logging. If you're new to Crosslight, read on.

Introduction to Crosslight

This Crosslight component is a fully-featured commercial component with 30 days Crosslight Project Wizard trial. If you're new to Crosslight, check out the Crosslight Starter Guide.

What's New

We're very excited to announce that Crosslight 4 is now available to the public. In this release, we're bringing tons of upgrades to enable easier cross-platform enterprise mobile development, such as comprehensive charting suite, Azure Application Insights-integrated logging framework, gorgeous dialog presenter, fail-proof sync framework, new barcode scanner serviec, and lots more. Check out the full list below.

Crosslight 4 At a Glance

Even Smarter and More Powerful Crosslight Sync Framework

Supercharged Data Access Component

Business Oriented, Gorgeous Data Visualization

Innovative, Highly Versatile Dialog PResenter

Comprehensive Barcode Scanner Service

Improved Form Builder

What's New in Crosslight for iOS

What's New in Crosslight for Android

Improved IDE and Tooling Support

Improved Crosslight Project Wizard

Support Latest Xamarin Releases

New Crosslight Samples

Others

Intersoft Developer Center

Introducing Intersoft Developer Center, a one-stop portal for all your development needs. Featuring comprehensive and detailed documentation, plethora of samples and video tutorials, the Developer Center aims to answer all your questions about Crosslight.

Overview

Leveraging extensible architecture, MVVM design pattern and integration with Xamarin Platforms, Crosslight lets you easily build powerful iOS, Android and Windows native apps with a common application codebase including domain model, data access, and user interaction logic. And that's nearly 96% of your project's codebase. Built with cutting-edge portable framework and MVVM pattern, Crosslight lets you build cross-platform mobile apps by leveraging the programming skills and tools you loved – such as C#, MVVM, .NET and Visual Studio. Key features include:

  • Comprehensive and advanced mobile frameworks leveraging MVVM design pattern
  • Build native iOS, Android, Windows Phone 8 and Windows 8 apps with a single application codebase
  • Elegant, developer-friendly API based on platform standards
  • Universal data management with automatic binding
  • Streamlined navigation services supporting push, modal and nested navigation mode
  • Rich form builder with 20+ pre-built editors
  • Highly customizable editor controls ranging from auto resize textbox to image picker with camera support and more
  • Comprehensive mobile services for business apps
  • Native user experiences conforming to platform design guidelines
  • Support Visual Studio 2012 and Xamarin Studio
  • Integrated to Xamarin platforms with full AOT compliance
  • Time-saving Project Wizard featuring 30+ templates variants supporting iOS, Android, Windows Phone 8 and Windows 8

Important!

If you have purchased a the Crosslight component from the Xamarin Component Store, send us an email of your purchase details to sales@intersoftpt.com for further assistance.

Sample Code

Creating a data form editor in all platforms. When users tapped on the Save button, it will perform data saving, show a toast presenter and navigates back to the previous screen.

Shared Application Project

Powered by Crosslight Foundation, the shared application project contains shareable code that can be easily consumed on each platform. Shareable code includes various user interaction logic, reusable ViewModel classes, domain models, data access layers, and more.

Form Metadata:

The Form Metadata is a part of the form builder feature introduced in Crosslight; just by defining the metadata, you can easily create beautiful-looking forms complete with custom data validation and rich editing features.

    using Intersoft.Crosslight;
    using Intersoft.Crosslight.Forms;
    using MyInventory.ViewModels;
    using System;

    namespace MyInventory.Models
    {
        [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")]
                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
            {
                ...
            }

            //Define other sections and properties
            public class ActionSection
            {
                ...
            }
        }
    }

View Model

The ViewModel class contains shareable user interaction logic as well as interaction with the model, for instances performing navigation, showing a message presenter, and more. The ViewModel class will be then consumed by native views on each platform.

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Linq;
    using System.Windows.Input;
    using Intersoft.Crosslight;
    using Intersoft.Crosslight.Forms;
    using Intersoft.Crosslight.Input;
    using Intersoft.Crosslight.ViewModels;
    using MyInventory.Infrastructure;
    using MyInventory.ModelServices;
    using MyInventory.Models;

    namespace MyInventory.ViewModels
    {
        public class ItemEditorViewModel : EditorViewModelBase<Item>
        {
            public ItemEditorViewModel()
            {
               ...
            }

            public override void Navigated(NavigatedParameter parameter)
            {
                base.Navigated(parameter);

                if (parameter.Data != null)
                {
                    this.Item = parameter.Data as Item;
                }
                else
                {
                    this.Item = new Item();
                    this.Item.PurchaseDate = DateTime.Today;
                    this.Item.Quantity = 1;
                    this.Item.Category = this.Categories.ElementAt(0);

                    this.IsNewItem = true;
                    this.Title = "Add New Item";
                }
            }

            protected override void ExecuteSave(object parameter)
            {
                this.Validate();

                if (!this.HasErrors)
                {
                    if (this.IsDirty)
                    {
                        if (this.IsNewItem)
                        {
                            this.ItemRepository.Insert(this.Item);
                        }
                        else
                        {
                            this.ItemRepository.Update(this.Item);
                            this.OnDataChanged(this.Item);
                        }

                        // show quick status
                        this.ToastPresenter.Show("Changes saved", ToastDisplayDuration.Immediate);
                    }

                    this.IsDirty = false;

                     this.ItemRepository.SaveChanges(null, null);

                    this.NavigationService.Close(new NavigationResult(NavigationResultAction.Done));
                }
                else
                {
                    this.ShowErrorMessage();
                }
            }

            ...
        }
    }   

iOS

Consuming the Form Metadata from the view model on iOS:

    using Intersoft.Crosslight.iOS;
    using MyInventory.ViewModels;

    namespace MyInventory.iOS
    {
        public partial class ItemEditViewController : UIFormViewController<ItemEditorViewModel>
        {
        }
    }

Android

Consuming the Form Metadata from the view model on Android:

    using Android.App;
    using MyInventory.ViewModels;
    using Intersoft.Crosslight.Android;

    namespace MyInventory.Android
    {
        [Activity(Label = "Edit Item", Icon = "@drawable/icon")]
        public class ItemEditActivity : FormActivity<ItemEditorViewModel>
        {
        }
    }

Windows Phone

Consuming the Form Metadata from the view model on Windows Phone:

The page:

    <Intersoft:PhoneFormPage
        x:Class="MyInventory.WinPhone.Views.ItemEditPage"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Intersoft="clr-namespace:Intersoft.Crosslight.WinPhone;assembly=Intersoft.Crosslight.WinPhone"
        SupportedOrientations="PortraitOrLandscape" Orientation="Portrait">

        <Intersoft:PhoneFormPage.HeaderTemplate>
            <DataTemplate>
                <StackPanel Margin="4,17,0,28">
                    <TextBlock Text="CROSSLIGHT APP" Style="{StaticResource PhoneTextNormalStyle}"/>
                </StackPanel>
            </DataTemplate>
        </Intersoft:PhoneFormPage.HeaderTemplate>
    </Intersoft:PhoneFormPage>

The code-behind:

    using Intersoft.Crosslight;
    using MyInventory.ViewModels;

    namespace MyInventory.WinPhone.Views
    {
        [ViewModelType(typeof(ItemEditorViewModel))]
        public partial class ItemEditPage
        {
            public ItemEditPage()
            {
                InitializeComponent();
            }
        }
    }

Learn More

© Intersoft Solutions Corporation. All rights reserved.

Be the first to write a review