using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverTunes
{
    public partial class FolderBrowser : UserControl
    {
        public FolderBrowser()
        {
            InitializeComponent();

            tree.SelectionChanged += (s, e) =>
            {
                folderText.Text = (tree.SelectedItem as FolderTreeItem).Path;
            };
        }

        public event Action<string> Done;

        private void Ok(object sender, RoutedEventArgs e)
        {
            if (Done != null)
            {
                Done(folderText.Text);
            }
        }

        private void Cancel(object sender, RoutedEventArgs e)
        {
            if (Done != null)
            {
                Done(null);
            }
        }
    }
}
