AngularJS Directive and Service for HTML5 Audio

AngularJS Directive and Service for HTML5 Audio

While working on a project with my good friend we had the need to play audio playlists for a website. Originally we were using jPlayer but this seemed like overkill for what we needed. Plus, with our site built on the AngularJS framework, I wanted a more modular component like the rest of our code. As such, I decided to create an AngularJS implementation to handle HTML5 audio – a service for handling the audio functionality that is needed by…

Read More Read More

AngularJS Directive with Chart.js

AngularJS Directive with Chart.js

As part of a project I’m working on with my good friend Ryan we found a need to be able to easily create some charts to display some metrics to our users. As we’re using AngularJS on our site, the logical step was to create a reusable directive that would allow us to easily hook up charts wherever we needed them – and this is what I’m going to walk through in this post. I’ll assume you know the basics…

Read More Read More

Basic Form Validation with AngularJS and Bootstrap

Basic Form Validation with AngularJS and Bootstrap

Following on from my previous post, I’m going to cover adding some basic client side validation to the form we created. We’ll start with the fullName input, so add the required tag to the input element like this:

We’ve now stated that this input needs to have a value in order for our form to be valid. However, if you run the form you can leave the input blank and click submit, and the form will still close as…

Read More Read More

Modal Dialogs with AngularJS and Bootstrap

Modal Dialogs with AngularJS and Bootstrap

A modal dialog is a good way of displaying basic forms to the user, such as a login form, contact form etc. In this post I’m going to cover the basics of using a modal dialog with AngularJS, AngularUI and Bootstrap, giving us a simple modal form with some basic formatting that can be used for a number of scenarios. First thing to note is that I created this using Visual Studio, so some steps might be different for you,…

Read More Read More

Progress Bars and the BackgroundWorker – C# & WPF

Progress Bars and the BackgroundWorker – C# & WPF

This is just a quick introduction on my implementation of using a progress bar in WPF and C#. The first step is to create the progress bar itself, which is a built in WPF control. So create a dialog and place a progress bar control as so:

One thing to note here is that, in my opinion, for the tasks this implementation was originally designed for, an indeterminate progress bar would have been best. However I was tasked with…

Read More Read More

Resizing Bitmap Images in C# and WPF

Resizing Bitmap Images in C# and WPF

I found myself needing to resize a bitmap image I have in the resources of my project, and apply the resized image to a button. A quick Google found some suggestions, but no clear way of doing so – as such, I thought I’d show my solution here. The first step is to get the BitmapSource from the Bitmap image you have in the resources file:

Using this BitmapSource we can then use TransformedBitmap to get a new scaled…

Read More Read More