using System;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.IO;
using Telerik.Windows.Zip;

namespace ReadingZipTTv
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
        }
        
        public void buttonOpen_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();
            dialog.Filter = "Zip File | *.zip";
            bool? dialogResult = dialog.ShowDialog();
            if (dialogResult == true)
            {
                Stream stream = dialog.File.OpenRead();
                using (ZipPackage zipPackage = ZipPackage.Open(stream, FileAccess.Read))
                {
                    FileList.ItemsSource = zipPackage.ZipPackageEntries;
                }
            }
        }
    }
}
