void priorityUpButton_Click(object sender, EventArgs e)
 {
     TodoItemPriorityIncreased @event = new TodoItemPriorityIncreased(todoItem.id);
     state.LoadAndPersist(@event);
 }
        public IEvent transformEvent(TodoItemPriorityIncreased toTransform, IEvent transformAgainst)
        {
            if (transformAgainst.GetType().Equals(typeof(TodoItemDeleted)))
            {
                if (toTransform.aggregateId == ((TodoItemDeleted)transformAgainst).aggregateId)
                    //Delete todo item when other side has also deleted it. No problem, remove this event.
                    return new Unused();
            }
            else if (transformAgainst.GetType().Equals(typeof(TodoItemPriorityChanged)))
            {
                //Can just append
            }
            else if (transformAgainst.GetType().Equals(typeof(TodoItemPriorityDecreased)))
            {
                //Can just append
            }
            else if (transformAgainst.GetType().Equals(typeof(TodoItemPriorityIncreased)))
            {
                //Can just append
            }
            else if (transformAgainst.GetType().Equals(typeof(TodoItemsDeleted)))
            {
                //If the item deleted is deleted by multiple on the server, remove this event
                if (((TodoItemsDeleted)transformAgainst).aggregateIds.Contains(toTransform.aggregateId))
                    return new Unused();
            }

            return toTransform;
        }