Skip to content
This repository has been archived by the owner on Feb 20, 2022. It is now read-only.
/ NZazu Public archive

NZazu, a wpf templating engine to create a dynamic form for user input.

Notifications You must be signed in to change notification settings

awesome-inc/NZazu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

NZazu is a WPF form templating engine which renders a form based on an abstract form definition.

Join the chat at https://gitter.im/awesome-inc/NZazu Build status

NuGet Version NuGet Version

NZazuFiddle

The sample application NZazuFiddle can be used for designing forms in real-time

NZazuView

The main view NZazuView connects factories, strategies and serializer to be flexible and extensible.

FormDefinition

A FormDefinition defines a form with field types, descriptive texts and prompts. The definition is independent from the kind of data storage (e.g. object, dictionary) or rendering (e.g. wpf controls from Xceeds Extended WPF Toolkit)

FormDefinition = new FormDefinition
{
    Fields = new[]
    {
        new FieldDefinition
        {
            Key = "settings", 
            Type = "label",
            Prompt = "Settings",
            Description = "You can manage your account here."
        },
        new FieldDefinition
        {
            Key = "name", 
            Type = "string",
            Prompt = "Name",
            Hint = "Enter name",
            Description = "Your account name. Only alpha-numeric ..."
        },
        new FieldDefinition
        {
            Key = "isAdmin", 
            Type = "bool",
            //Prompt = "Is Admin",
            Hint = "Is Admin",
            Description = "Check to grant administrator permissions"
        }
    }
}

INZazuWpfFieldFactory

The field factory created the fields depending on several strategies and its own implementation of CreateField() to create and compose fields.

The factory suports INZazuWpfFieldBehaviorFactory, ICheckFactory and INZazuDataSerializer strategy factories to support custom behavior, serialization and checks. Details see below.

INZazuFieldFactory

The field factory creates fields (controls) based on a template definition. By default, the following factories are implemented.

  • NZazuFieldFactory (main package)
  • XceedFieldFactory (xceed package)

INZazuLayoutStrategy

The layout strategy provides the mechanism to render the generated fields into the NZazuView

  • GridLayoutStrategy (main package)
  • StackedLayoutStrategy (main package)

INZazuDataSerializer

The data serializer is used for e.g. data table to serialize a big amount of data. Currentyl the following strategies are implemented

  • NZazuXmlSerializer (main package)
  • NZazuJsonSerializer (json serializer package)

Default Extender

Basic custom behavior and checks can be implemented using the interface for behaviors INZazuWpfFieldBehavior and checks IValueCheck.

Custom Field Behavior

Implement the interface INZazuWpfFieldBehavior and register the implementation at the behavior extender.

BehaviorExtender.Register<OpenUrlOnStringEnterBehavior>("OpenUrlOnStringEnter");

Custom Checks

Implement the interface IValueCheck and implement an ICheckFactory (which should overwrite the existing implementation).

Contribs

Icons

Some icons are taken from http://www.iconarchive.com/show/oxygen-icons-by-oxygen-icons.org/Actions-go-jump-today-icon.html