/// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private static void AddFeedItemToParent(object sender, RoutedEventArgs e)
        {
            // Get user input
            var addFeedWindow = new HelperWindows.AddFeedWindow();
            addFeedWindow.ShowDialog();

            if (addFeedWindow.DialogResult == true)
            {
                // Create feed and and add it to the engine
                Feed newFeed = new Feed(addFeedWindow.Feed.Item1, addFeedWindow.Feed.Item2);
                _subscriptions.AddFeed(newFeed);

                TreeViewItem feedViewItem = MakeTreeViewItem(newFeed.Name);
                
                feedViewItem.ContextMenu.Items.Add(MakeContextMenuItem(RemoveGestureText, RemoveMenuOption));
                feedViewItem.ContextMenu.Items.Add(MakeContextMenuItem(RenameGesureText, RenameMenuOption));

                // Add to UI
                TreeView.Items.Add(feedViewItem);
            }
        }
        /// <summary>
        /// tester for Facade
        /// </summary>
        public static void AddFeedToTree()
        {
            var createFeedWindow = new HelperWindows.AddFeedWindow();
            createFeedWindow.ShowDialog();

            if (createFeedWindow.DialogResult == true)
            {
                // Create feed and add it
                var feed = new Feed(createFeedWindow.Feed.Item1, createFeedWindow.Feed.Item2);

                var feedViewItem = MakeTreeViewItem(createFeedWindow.Feed.Item1);

                feedViewItem.ContextMenu.Items.Add(MakeContextMenuItem(RemoveGestureText, RemoveMenuOption));

                if (SelectedTreeViewItem != null)
                {
                    var channel = _subscriptions.SearchForChannel(((TreeViewItem)SelectedTreeViewItem)?.Header.ToString());
                    if (channel != null)
                    {
                        channel.AddFeed(feed);
                        (SelectedTreeViewItem as TreeViewItem).Items.Add(feedViewItem);
                    }
                }
                else
                {
                    TreeView.Items.Add(feedViewItem);
                }
                

                _subscriptions.AddFeed(feed);
            }
        }
        /// <summary>
        /// Adds a feed to the visual tree
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private static void AddFeedItem(object sender, RoutedEventArgs e)
        {
            TreeViewItem parent = TreeView.SelectedItem as TreeViewItem;

            if (parent != null)
            {
                HelperWindows.AddFeedWindow addFeedWindow = new HelperWindows.AddFeedWindow();
                addFeedWindow.ShowDialog();

                if (true == addFeedWindow.DialogResult)
                {
                    Feed newFeed = new Feed(addFeedWindow.Feed.Item1, addFeedWindow.Feed.Item2);
                    AddFeed(newFeed);

                    TreeViewItem feedViewItem = MakeTreeViewItem(newFeed.Name);
                    
                    feedViewItem.ContextMenu.Items.Add(MakeContextMenuItem(RemoveGestureText, RemoveMenuOption));
                    try
                    {
                        parent.Items.Add(feedViewItem);
                    }
                    catch (InvalidOperationException)
                    {
                        ((TreeViewItem)parent.Parent)?.Items.Add(feedViewItem);
                    }

                    var subscriptionParent = _subscriptions.SearchForChannel(parent.Header.ToString());

                    subscriptionParent?.AddFeed(newFeed);
                }
            }
        }
        /// <summary>
        /// Add a feed to the tree and subscription object
        /// </summary>
        /// <remarks>
        /// Mainly used in facade
        /// </remarks>
        public static void AddFeedToTree(Tuple<TreeViewItem, Channel> parent)
        {
            var createFeedWindow = new HelperWindows.AddFeedWindow();
            createFeedWindow.ShowDialog();

            if (createFeedWindow.DialogResult == true)
            {
                // Create feed and add it
                var feed = new Feed(createFeedWindow.Feed.Item1, createFeedWindow.Feed.Item2);

                var feedViewItem = MakeTreeViewItem(createFeedWindow.Feed.Item1);

                feedViewItem.ContextMenu.Items.Add(MakeContextMenuItem(RemoveGestureText, RemoveMenuOption));

                if (parent != null)
                {
                    parent.Item2?.AddFeed(feed);
                    parent.Item1.Items.Add(feedViewItem);
                }
                else
                {
                    TreeView.Items.Add(feedViewItem);
                }
            
                _subscriptions.AddFeed(feed);
            }
        }