public SettingsWindow(MainWindow main, UploaderViewModel viewModel)
        {
            InitializeComponent();

            //Owner = main;

            _main = main;
            _viewModel = viewModel;

            if (_viewModel.Username != null)
            {
                UsernameBox.Text = _viewModel.Username;
                PasswordBox.Password = _viewModel.Password;

                UsernameBox.IsEnabled = false;
                PasswordBox.IsEnabled = false;
                RemoveButton.Visibility = Visibility.Visible;
            }

            if (_viewModel.Proxy == null)
                UseSystemRadio.IsChecked = true;

            else if (_viewModel.Proxy == UploaderViewModel.ProxyDisabled)
                DisableProxyRadio.IsChecked = true;

            else
            {
                ProxyAddressBox.Text = _viewModel.Proxy;
                UserDefinedRadio.IsChecked = true;

            }

            UsernameBox.Focus();
        }
        public MainWindow(UploaderViewModel vm)
        {
            InitializeComponent();

            Uploader = vm;
            Uploader.LogUpdate += new EventHandler<LogEventArgs>(LogUpdate);
            Uploader.StatusChanged += new EventHandler<UploaderStatusEventArgs>(StatusChanged);

            ActiveList.ItemsSource = Uploader.Active;
            CompleteList.ItemsSource = Uploader.Complete;
        }
        public UploadViewModel(UploaderViewModel main, Upload upload)
        {
            _main = main;
            Upload = upload;
            _active = true;
            Size = UploaderViewModel.SizeFormatter(Upload.Size);
            SetStatusMessage();
            SetProgress(0);

            Upload.StatusChanged += new EventHandler<UploadStatusEventArgs>(UploadStatusChanged);
            Upload.ProgressChanged += new EventHandler<UploadProgressEventArgs>(UploadProgressChanged);
            Upload.SpeedChanged += new EventHandler<UploadSpeedEventArgs>(UploadSpeedChanged);
            Upload.ETAChanged += new EventHandler<UploadETAEventArgs>(UploadETAChanged);
        }