Exemplo n.º 1
0
        /// <summary>
        /// 图片操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnOperate_Click(object sender, RoutedEventArgs e)
        {
            Button  btn = sender as Button;
            DataRow row = dtTemp.Select(string.Format("Id = {0}", btn.Tag))[0];

            switch (btn.Content)
            {
            case "Del":
                break;

            case "Edit":
                break;

            case "Browser":
                PhotoViewModule viewModule = new PhotoViewModule(row["PicturePath"].ToString());
                CommonHelper.MainWindow.brMain.Child = viewModule;
                break;

            case "Upload":
                break;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 图片操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnOperate_Click(object sender, RoutedEventArgs e)
        {
            Button     btn   = sender as Button;
            UploadFile model = UploadFiles.Where(x => x.Id == btn.Tag.ToString()).FirstOrDefault();

            switch (btn.Content)
            {
            case "Del":
                if (!CommonHelper.DeleteConfirm())
                {
                    break;
                }
                UploadFiles.Remove(model);
                model.Delete();
                break;

            case "Edit":
                PhotoEditModule editModule = new PhotoEditModule
                {
                    ParentControl = this,
                    UploadFile    = model
                };

                App.CurrentWindow.brMain.Child = editModule;
                break;

            case "Browser":
                PhotoViewModule viewModule = new PhotoViewModule(model.FileFullName)
                {
                    ParentControl = this
                };
                App.CurrentWindow.brMain.Child = viewModule;
                break;

            case "Upload":
                MessageBox.Show("Has joined the upload queue!");
                break;
            }
        }