コード例 #1
0
 private void OnOpenAsBinaryFile(object sender, RoutedEventArgs e)
 {
     if (Model is NullPreviewModel)
     {
         return;
     }
     Model?.Dispose();
     Model = new BinaryFilePreviewModel(FilePath);
 }
コード例 #2
0
        private void OnOpenAsTextFile(object sender, RoutedEventArgs e)
        {
            var selectedEncoding = ((BinaryFilePreviewModel)Model).SelectedEncoding;

            if (selectedEncoding == null)
            {
                MessageBox.Show("Please select an encoding");
                return;
            }
            Model?.Dispose();
            Model = new TextFilePreviewModel(FilePath, selectedEncoding);
        }