Posts From July, 2017

Updated Contact Details 


If your in Australia, Singapore, London (UK), San Francisco or New York (USA) you can call one of our local offices for all your software needs.

Australia - Newcastle - Ph: (02) 4040-9827
USA - San Francisco - Ph: +1 (650) 457-0102
USA - New York - Ph: +1 (347) 434-9330
UK - London - Ph: +44 (20) 364-20520
Singapore - Ph: +65 315-91468

Email: sales@castlesoft.com.au

These details are shown on our Office and Contact Pages (as shown below):

Office Locations

 

Map showing Office Locations

 

Posted by Andrew Tierney Sunday, July 30, 2017 3:54:00 PM Categories: CastleSoft

WiseJ 10% off – CODE: 5B6B5E 

Wisej is an open Web Integrated Server Environment to design, build, debug, and manage Real Time Web Applications using C#/VB.NET and JavaScript in Visual Studio.

Fast Development
Create complex Web Applications in a fraction of the time compared to traditional ASP.NET or MVC.

Flat Learning Curve

C# and VB.NET developers are productive in no time using a familiar development environment and a well-established programming paradigm.

Open and Integrated

Wisej integrates any third party JavaScript widget in a standard and consistent framework, making the resulting application easier to maintain and to deploy.

WiseJ

 

Posted by Andrew Tierney Saturday, July 22, 2017 8:12:00 PM Categories: .NET CastleSoft Wisej

“Xamarin University Presents” Webinar Recordings 

Thousands of developers have attended this year’s Xamarin University Presents webinar series, and we’ve had a great time introducing developers to the breadth of apps they can build with Xamarin Tools for Visual Studio. We’ve just wrapped up FIVE NEW webinars, covering topics that range from building your first cloud-connected game with SpriteKit to adding intelligent APIs with Machine Learning. Combined with the earlier videos, these new webinar recordings help provide you with everything you need to ship amazing mobile apps using the IDE, language, and code you know and love.

Two of our most popular webinars in this second round of topics were Introduction to Xamarin.Forms for Visual Studio 2017 and SkiaSharp Graphics for Xamarin.Forms with Charles Petzold, which you can find in full below. Head to the full playlist here to access all of the Xamarin University Presents webinar recordings, including the first five in the series and the other three from last month, Building games for iOS, macOS, and tvOS with Visual Studio and AzureCustomizing Xamarin.Forms UI, and Introduction to Azure Machine Learning.

Introduction to Xamarin.Forms for Visual Studio 2017

 

 

SkiaSharp Graphics for Xamarin.Forms

 

 

Don’t miss the other eight videos in the Xamarin University Presents series—head to the full playlist to learn about everything from building your first Xamarin.Forms app with Xamarin for Visual Studio to building games for iOS, macOS, and tvOS with Visual Studio and Azure.

 

Full Playlist

 

 

The post “Xamarin University Presents” Webinar Recordings appeared first on Xamarin Blog.

Posted by Andrew Tierney Saturday, July 8, 2017 6:13:00 PM Categories: .NET Xamarin

New Singapore Office 

CastleSoft is proud to announce the opening of our Singapore office (details shown below and on our contact and offices pages). If your in Australia, Singapore, London (UK), San Francisco or New York (USA) you can call one of our local offices for all your software needs.
 

 

 

 

Posted by Andrew Tierney Thursday, July 6, 2017 7:18:00 PM Categories: CastleSoft

Beautiful UI made possible and easy with Windows.UI and the Windows 10 Creators Update 

By 

Since its original debut with the Windows 10 November 2015 updateWindows.UI.Composition has been empowering developers to build fast, beautiful, sweet user interfaces in UWP and has been providing enhancements with every subsequent Windows release. At Build 2017, we revealed what all of this continuous work has been leading up to: The Fluent Design System (aka ‘Project Neon’).

Moving from classic ‘Flat Design’ to Fluent Design requires the visual and performance capabilities that the Composition APIs offers along with the interop features that let you draw on this power from your XAML layer. In case you are not yet familiar with the concepts behind the Composition APIs, here’s a quick refresher on what the Composition APIs are all about.

The Windows.UI.Composition namespace allows Universal Windows Platform (UWP) developers to use a new Visual Layer that will get them closer to the metal, graphically speaking, while still using familiar technologies like XAML and C#. By getting closer to the metal, actually down to the system compositor level, developers are able to get great visual performance and custom UI experiences. By working through the XAML layer, developers get the ease of use they have come to expect out of UWP. This is basically a best of both worlds scenario that puts great responsibility in the developer’s hands. And with great responsibility, as we all know, comes great power.

So why do you need all these graphical and UX superpowers? In addition to giving pizazz to your UWP apps, access to the system compositor level also helps your users to accomplish their tasks faster and more fluidly. For instance, when you use Composition effects to blur a background in response to a click, you are focusing the user’s attention on her current task and removing distractions. This is the sort of subtle UI implementation that actually makes your user’s life easier – and it works best when your user doesn’t even know that you did anything for them. They are just left with the impression that your app is easy to use and feels fast, even if they can’t exactly put their finger on the reason.

The Visual family

To better understand the basic principles of Windows.UI.Composition, it’s important that we also introduce you to the visual family. In order to get fast and fluid effects, you need direct access to something called the system compositor(sometimes also referred to as the DWM). The system compositor is agnostic to the UI thread and doesn’t really care about being on the UI thread or blocking threads. Things happen very quickly at the system compositor level, where everything that is about to be sent to the display screen gets put together. This is also where you get to add additional effects if you want to just before shipping all your visuals to the display.

The visual family lives down at that compositor level where things happen rapidly. The visual family is made up of Visuals, ContainerVisuals and SpriteVisuals. The SpriteVisual class inherits from container visual, and the ContainerVisual class inherits from the base Visual class. There is also a Compositor class which acts as the senior member of the visual family. It quite literally creates visual objects if you need them and also manages the relationship between an application and the system compositor process.

The visual family is a lot of fun. Let’s say your XAML, many levels above, has a Grid object. That Grid will have a member of the visual family assigned to it. In technical parlance, we say that the Grid is backed by a visual. Once you grab hold of this backing visual, you can start to animate it using the composition animation system. If it is a ContainerVisual, then you can add additional visuals to it. Finally, you can also create sprite visuals, using the compositor factory class, in order to add brush effects to your visual using the Windows.UI.Composition effects system.

What’s new for sweet UI in the Windows 10 Creators Update

Several highly requested UI.Composition features have been added in the Creators Update to support fast and fluid UI as well as the Fluent Design System, for instance:

  • SVG support
  • Normal and Virtual Surfaces
  • Hover Interactions
  • Implicit Show and Hide
  • Expression Helpers
  • Offset stomping fix

At first these can seem like small disconnected improvements. Brought together, however, they will make creating beautiful UI both faster and easier.

XAML support for static SVG files

Vector images are often better for icons and logos because they can be resized without losing image quality. Before the Windows 10 Creators Update, however, vector graphics were not supported in XAML and working with iconography in UWP typically involved multiple versions of every image to adapt for multiple DPIs.  Now that that problem is solved, not only does XAML support static SVG files, but they also work with the Composition APIs.

Normal and virtual surfaces

The CompositionDrawingSurface has been a core component of the Composition APIs since the beginning, facilitating interop between XAML and Direct2D or Direct3D. The Creators Update is introducing the CompositionVirtualDrawingSurface for situations where only a portion of the content needs to be shown to the user at any given time. It basically bridges the concepts of graphics culling in video games and the development of infinite lists in desktop enterprise apps.

Independent hover interactions off the UI thread

One of the most powerful things about the Composition APIs is that they allow effects and animations to run independently of your main UI thread at 60 frames per second. With the Creators Update, this feature will also apply to hover animations in order to light up the many pointer activated effects that are a major part of fluent design.

There is also a subtle computer etiquette benefit to this new feature. Have you ever watched a busy animation play while your app’s UI was hanging and tried to move your mouse around in circles to try to make the animation go faster, but it has no effect? That is now a thing of the past.

Implicit show and hide

If you look at the code behind any UWP app, you will likely find that a large portion of UI code is devoted to setting visibility properties on UIElements in order to alternatively hide and show content. With this understanding, the Composition APIs now allow you to associate animations with your visual elements that are implicitly triggered when you hide or show them.

    ElementCompositionPreview.SetImplicitShowAnimation(MainContent, mainContentShowAnimations);
    ElementCompositionPreview.SetImplicitHideAnimation(MainContent, mainContentExitAnimation);

Implicit hide and show animations allow you to continue using this basic UI metaphor while also making it easier to create elegant visuals around them.

Expression helpers

Expression animations provide a way to create mathematical relationships between composition objects that can then be used to drive animations. The results of applying expression animations can often be breathtaking.

One piece of feedback we received about how we implemented expression animations is that it depends heavily on long strings of text like the following:

  rotationAnimation.Expression = "ACos( ( (A.Offset.X * B.Offset.X) + (A.Offset.Y*B.Offset.Y) + (A.Offset.Z * B.Offset.Z) ) / ( Length(A.Offset) *  Length(B.Offset) ) )";
  lineVisual.StartAnimation("RotationAngle", rotationAnimation);

The phrase “magic number” may even have been raised with respect to this. Just in time for the Creators Update, the Expression Builder Library is being introduced to provide you with type safety, IntelliSense and autocompletion as you create your own amazing expression animations.

Translation property

In earlier versions of the Composition APIs, there was a complication in the way UIElement properties were shared between the XAML layer and the Visual Layer that could cause the actual position of the visual to be overwritten or “stomped” in response to layout changes. While there was a workaround previously, there is now an actual fix with the new translation property. To prevent offset stomping, you now just need to enable the new Translation property through the ElementCompositionPreview class.

ElementCompositionPreview.SetIsTranslationEnabled(Rectangle1, true);

This is one of those issues that, if you’ve run into it before, you will feel a slight sense of relief. Just add a mental bookmark for yourself about the Translation property until you need to use it.

The sample gallery

The best way to deep dive into Windows.UI.Composition is by pulling down the sample code that the Composition team created and published to Github. The Windows UI Dev Labs samples, as they’re called, are extensive and visually rich. The samples extend from simple photo effects to complex parallax animations on XAML controls.

Don’t hesitate. It’s hard to really grasp the magnitude of the visual capabilities you are getting with Windows.UI.Composition until you see for yourself all that it empowers you to do.

Wrapping up

In addition to diving into the sample gallery on Github, which is highly recommended, you can also learn more about Windows Composition through the following articles, videos and blog posts.

Posted by Andrew Tierney Thursday, July 6, 2017 11:38:00 AM Categories: .NET Microsoft

Announcing UWP Community Toolkit 1.5 

By 

Today marks the sixth release of the UWP Community Toolkit – all packages are updated to version 1.5. Thanks to the UWP developer community, the UWP Community Toolkit has seen great improvements and stability to the existing controls and services. The community partnership has led to several new additions to this release.

To highlight a few of the new additions, the UWP Community Toolkit now includes:

  1. Menu: A classic control used by traditional desktop applications, adapted for the Universal Windows Platform. As requested by the community on UserVoice, the Menu allows the developer to provide a hierarchical list of menus and submenus that support any input modality and can adapt to the screen size to provide a natural and fluid interaction.
  2. OrbitView: A new ItemsControl that arranges elements around a center element and provides flexibility for size and distance for each element, as well as the ability to show orbits or anchors for each item.
  3. RadialProgressBar: A XAML Control that displays a value within a range using a circular sector that grows clockwise until it becomes a full ring. A fantastic variation of the ProgressBar.
  4. RoundImageEx: Similar to the ImageEx control, the RoundImageEx control downloads and locally caches images asynchronously while showing loading indicators. In addition, the RoundImageEx allows images to be clipped as circles.
  5. ExpressionBuilder: A type-safe way to build powerful composition ExpressionAnimation.
  6. BluetoothLEHelper: The BluetoothLEHelper class provides functionality to easily enumerate, connect to and interact with Bluetooth LE Peripherals.

For a complete overview of what’s new in version 1.5, please read our release notes on GitHub.

The release of Windows 10 Creators Update (build 10.0.15063) has enabled several new APIs that make it possible to improve several controls used in apps targeting the latest update. Therefore, several packages are now targeting the Windows 10 Creators Update and can take advantage of these new APIs. We encourage all developers using the toolkit to update their apps to the latest version of the UWP Community Toolkit.

As a reminder, the UWP Community Toolkit can be used in any UWP app across PC, Xbox One, mobile, HoloLens and Surface Hub devices. You can get started by following this tutorial, or preview the latest features by installing the UWP Community Toolkit Sample App from the Windows Store.

If you would like to contribute, please join us on GitHub!

Posted by Andrew Tierney Thursday, July 6, 2017 11:17:00 AM Categories: .NET Microsoft

Going Global with Xamarin and Azure Cosmos DB 

-- The post Going Global with Xamarin and Azure Cosmos DB appeared first on Xamarin Blog.

Imagine that MyTeaCompany is a locally renowned business in Pune, India, supplying tea to the area from their ten shops within the city. They supply a huge variety of teas from Darjeeling to Assam and Thai to Korean, among others. They decide they want to take their business to the next level and create a worldwide presence on the internet.

Today, we’re going to take a look at how utilizing the Azure Cosmos DB database solution in their new Xamarin mobile app can help them leverage a wider customer-base on the global platform.

Building the Azure Cosmos DB solution

Azure Cosmos DB is a scalable, globally distributable solution for all your data requirements. It supports different models, including Graph, Table, and DocumentDb, with APIs available in different technologies, such as .NET, Python and Java. This makes it the perfect solution for all of MyTeaCompany’s data needs.

You can use the Azure Cosmos DB Emulator for developing and testing apps locally. However, for today’s blog post, we’ll use our Microsoft Azure Subscription.

Create an Azure Cosmos DB Account

Head to Azure Portal and create an Azure Cosmos DB account using the ‘+’ sign and navigating to Databases > Azure Cosmos DB. Once created, click on “Keys” and note the details, as those will be required in future steps.

It’s important to decide on the partition key, which helps to span data across servers or partitions, when creating a collection. It’s also important to carefully select your Request Units(RUs), which can play a major role in expected performance. The guide on the Request Unit Calculator is a great resource to help you gauge your requirements.

Xamarin.Forms Mobile App

Since we’re targeting multiple platforms, Xamarin.Forms is the perfect choice for MyTeaCompany, allowing us to maximize code sharing while still being able to use the native controls and features of each individual platform.

Create a Xamarin.Forms Project

In Visual Studio 2017, create a Xamarin.Forms solution by selecting New Project… > Cross-Platform > Cross-Platform App (Xamarin) > Blank / Shared Project. We’ll want to add the Microsoft.Azure.DocumentDB.Core NuGet package to the projects in order to use the package responsible for communicating with the Cosmos DB services.

Define Endpoint Constants

We need to define the endpoints in the Constants.cs file in order to connect the Xamarin.Forms application with Cosmos DB:

 

//copy details from your Keys section here
public static readonly string EndpointUri = "https://my-tea-company.documents.azure.com:443/";
public static readonly string PrimaryKey = "SKAF9lv43HeXicHgH-----------2yiFff7HPBOyFV0A==";
public static readonly string DatabaseName = "my-tea-company";
public static readonly string CollectionName = "my-tea-company";

 

Our model is StoreInfo which represents the MyTeaCompany store details.
StoreInfoManager is the helper class that wraps around IDocumentDBService. This class helps us perform CRUD operations on our data. The DocumentDBService class implements IDocumentDBService and uses the details provided in the Constants.cs file to perform these CRUD operations.

 

class DocumentDBService : IDocumentDBService
{
   DocumentClient client;
   Uri collectionLink;
   public DocumentDBService()
   {
      client = new DocumentClient(new Uri(Constants.EndpointUri), Constants.PrimaryKey);
      collectionLink = UriFactory.CreateDocumentCollectionUri(Constants.DatabaseName, Constants.CollectionName);
   }
...
}

 

Going Global

After MyTeaCompany deploys their app using Azure Cosmos DB and Xamarin, they see a huge opportunity in Seattle, WA. They decide to open a store there and start serving customers through the existing app. With few changes the app can be configured to serve users in that geographic area. First, they needed to replicate the store and product data to the new Azure Regions, which can be done from the Azure Portal.

Once the the data is replicated, using ConnectionPolicy nearest Azure Regions could be set as PreferredLocations to keep the latency low.

 

public DocumentDBService()
{
   ConnectionPolicy connectionPolicy = new ConnectionPolicy();
   connectionPolicy.PreferredLocations.Add(LocationNames.WestUS);
   client = new DocumentClient(new Uri(Constants.EndpointUri), Constants.PrimaryKey, connectionPolicy);
   collectionLink = UriFactory.CreateDocumentCollectionUri(Constants.DatabaseName, Constants.CollectionName);
}

 

By making two simple changes, the entire solution was made available in an entirely new region. Tomorrow, if MyTeaCompany wanted to open a store in Europe, they could expand their reach to the region in just a couple of clicks.

Conclusion

Azure Cosmos DB makes it easy to build globally distributed, scalable, highly available and low latency data solutions, which can be easily integrated with Xamarin mobile apps. You can check out the completed sample described in this post here and the documentation for Azure Cosmos DB can be found here. You can also see our guide on Storing Data in a Document Database for more information.

 

Posted by Andrew Tierney Sunday, July 2, 2017 8:38:00 PM Categories: Xamarin