123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- using Microsoft.Win32;
- using vCloud.TestClientUi.ViewModel;
- namespace vCloud.TestClientUi
- {
- /// <summary>
- /// MainWindow.xaml 的交互逻辑
- /// </summary>
- public partial class MainWindow : Window
- {
- private MainpageViewModel _viewModel;
- public MainWindow()
- {
- InitializeComponent();
- _viewModel = new MainpageViewModel();
- DataContext = _viewModel;
- }
- private void UploadFile_Click(object sender, RoutedEventArgs e)
- {
- if (_viewModel != null)
- {
- var open = new OpenFileDialog();
- open.Title = "请选择文件";
- open.Filter = "所有文件(*.*)|*.*";
- if (open.ShowDialog() == true)
- {
- _viewModel.FileName = open.FileName;
- _viewModel.UploadFileCommand.Execute(null);
- }
- }
- }
- }
- }
|