private async void EditCategory(object sender, RoutedEventArgs e)
        {
            var element = (FrameworkElement) sender;
            var category = element.DataContext as Category;
            if (category == null)
            {
                return;
            }

            var dialog = new CategoryDialog(category);
            await dialog.ShowAsync();
        }
        private async void EditCategory(object sender, RoutedEventArgs e)
        {
            var element = (FrameworkElement) sender;
            var category = element.DataContext as Category;
            if (category == null)
            {
                return;
            }

            var repository = ServiceLocator.Current.GetInstance<IRepository<Category>>();
            repository.Selected = category;

            var dialog = new CategoryDialog(true);
            await dialog.ShowAsync();
        }