Ejemplo n.º 1
0
        private void Base64Window_Unloaded(object sender, RoutedEventArgs e)
        {
            Base64ViewModel viewModel = this.DataContext as Base64ViewModel;

            if (viewModel != null)
            {
                viewModel.OperationSucceeded     -= ViewModel_OperationSucceeded;
                viewModel.OperationCancelled     -= ViewModel_OperationCancelled;
                viewModel.OperationErrorOccurred -= ViewModel_OperationErrorOccurred;
            }
        }
Ejemplo n.º 2
0
        private void SourceFilePathTextBox_Drop(object sender, DragEventArgs e)
        {
            String[] files = e.Data.GetData(DataFormats.FileDrop) as String[];

            if (files != null && files.Length > 0)
            {
                Base64ViewModel viewModel = this.DataContext as Base64ViewModel;

                if (viewModel != null)
                {
                    if (viewModel.SelectedActionIndex == 1 &&
                        !Constants.TextFileFilter.Contains(Path.GetExtension(files[0])))
                    {
                        return;
                    }

                    viewModel.SourceFilePath = files[0];
                }
            }
        }