• Overview
  • Documentation
  • GitHub
  • Blog
  • Premium support
  • Contact

Blog

Home Blog

Ammy is completely free from now on!

April 5, 2017ionoyUncategorizedNo Comments

Ammy is now permanently free for any type of development. It doesn’t matter if it’s internal commercial project or open source charity one. It’s free for everybody!

Since launching Ammy we heard lots of very positive feedback. Most people love Ammy’s concise syntax and seemingly endless possibilities, especially compared to vanilla XAML. But there was one recurring problem bothering people – licensing model. Small business customers are afraid to invest in a new technology. Large enterprise ones require notoriety to bring in new technology to their stack. It’s a vicious cycle.

It would be a real tragedy for such a cool project as Ammy to fail because of mistakes made in licensing model. More than anything we want Ammy to succeed and become a new trend in XAML development. With Ammy everyone can become a better UI developer and every project can become a UX masterpiece.

So, it was decided that Ammy should be free for everyone and some other ways of monetization should be found. At the moment there are few ideas, some already implemented like “Ammy school” and “Premium support”. Others are still in idea form, like an extended library(-ies) full of cool features for business customers. If you have more thoughts on the subject, please share in comments or via email.

Follow us on twitter to stay updated!

Follow @ionapps

Read More

Introducing binding converters

January 22, 2017ionoyUncategorizedNo Comments

XAML platforms use binding converters to transform data bound to properties. Most of us wrote, or at least saw code like this:

<TextBlock Visibility="{Binding ShouldBeVisible, Converter={StaticResource BooleanToVisibilityConverter}}" />

(don’t forget, you also need to add BooleanToVisibilityConverter object to resources collection)

This is because property of type bool cannot be implicitly converted to Visibility. So, you can either use a converter already provided by a framework or write you own. Converter would take boolean value as an argument and return visibility. It means, that every time your data cannot be directly applied to a markup you need to write a class that would deal with it.

Ammy strives to make all previously tedious tasks feel easy and natural. So, we have added inline binding converters.
Example from above would read like this:

bind ShouldBeVisible
convert (bool visible) => visible ? Visibility.Visible : Visibility.Hidden

In short, it takes a bound value and applies a lambda expression provided by you. You can do pretty cool stuff with it, like toggling visibility depending on width:

Visibility: bind ActualWidth from $this
            convert (double width) => width > 600 ? Visibility.Visible : Visibility.Hidden

or formatting complex strings:

Text: bind //Empty Path means 'bind to datacontext'
      convert (Guest guest) => guest.FirstName[0] + ". " + guest.LastName

or changing background color depending on a gender:

Background: bind Gender
            convert (Gender gender) => gender == Gender.Male ? Brushes.LightBlue : Brushes.Pink

Binding expressions support most of the stuff C# compilers supports. But it’s a very simplified syntax, so you can’t use statements, define variables or write any code that is beyond converter scope.

Here is a video of binding converters being used in practice.

To use Ammy you need Ammy Visual Studio Extension and Ammy NuGet package.
For more information, please refer to www.ammyui.com/documentation/quickstart

Project website: www.ammyui.com

Read More

Ammy – Modern UI language for XAML platforms

January 4, 2017ionoyUncategorized21 comments

What is Ammy?

Ammy is a JSON-like UI language for developing XAML based applications. It has a concise, well structured syntax that is both easy to read and write. During compilation Ammy files are translated to XAML and compiled as normal XAML controls.

The “Hello, World!” example in Ammy looks something like this:

Window "MyApp.MainWindow" {
  TextBlock { "Hello, World!" }
}

Ammy’s MSBuild task will generate a XAML file with “.g.xaml” extension alongside the original one with this content:

<Window x:Class="MyApp.MainWindow" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        Ammy.Register="/MyApp;component/MainWindow.g.xaml">
  <TextBlock>Hello, World!</TextBlock>
</Window>

Notice the Register attached property, it will be explained shortly.

Why should I use Ammy?

XAML is a great language, well thought-out and powerful. Nevertheless, it can be frustrating to write lots of XAML in order to achieve a smallest change. Styles are not composable, templates are big and complex. This means poor code reuse and long XAML files. Ammy offers mixins to solve this issue. Mixin is like a function, that is defined once and used as much as needed. For example:

mixin TwoRows(height1, height2) for Grid {
  RowDefinitions: [
    RowDefinition { Height: $height1 }
    RowDefinition { Height: $height2 }
  ]
}
 
Grid {
  #TwoRows(35, "*")
}

As you can see, mixins can take parameters and output content, either properties, nodes or both. This is a really powerful feature that can greatly improve code reuse and overall application architecture.

Ammy also has variables, used like this:

$normalFontColor="#3f3f3f"
 
TextBlock {
  Foreground: $normalFontColor
}

Once defined globally, variables can be used anywhere in a program. By the way, if a variable is defined inside a node and not in a global scope, then it will only be seen inside that node. Same can be said about mixins.

No recompilation needed!

Perhaps the most important Ammy’s feature is an ability to develop UI without recompilation. In fact, Register property we saw earlier is used to register your page to become updatable.

Run your application and while it is running, make modifications to user interface code, save file and see application updated! All of the state is preserved, and only parts of the UI that were actually changed in code are updated in the app.

Imagine, you are developing some complex settings page. From you main application you click “Settings” button, then you click some tab header to switch to your currently developed control. Normally you would have to repeat these steps every time you changed something and restarted your application, but with Ammy you just hit save, and observe updated UI.

Another, perhaps better example would be a twitter application. While designing a tweet look, usually you don’t want to reload whole backend just to see if increased font size looks better or not. Live user interface development is a great way to diminish development time. Things that previously took hours now take minutes.

Demonstation

This video shows development of a simple data entry application using Ammy framework. Note how structure and presentation are separated with the help of mixins.

How to install?

To use Ammy you need Ammy Visual Studio Extension and Ammy NuGet package.
For more information, please refer to www.ammyui.com/documentation/quickstart

Project website: www.ammyui.com

Read More
© 2017 Ammy by ION OÜ