| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
-
- /* ==============================================================================
- * 功能描述:选择路径控制,选择路径的按钮在文本框前面
- * 创 建 者:SAGACLOUD
- * 创建日期:2017/9/17
- * ==============================================================================*/
- using System;
- using System.IO;
- using System.Windows;
- using System.Windows.Media.Imaging;
- using WPG.Data;
- namespace WPG.UserControls
- {
- /// <summary>
- /// SelectPath_Start.xaml 的交互逻辑
- /// </summary>
- public partial class UcPopups_Nameplate
- {
- public UcPopups_Nameplate()
- {
- InitializeComponent();
- }
-
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- Microsoft.Win32.OpenFileDialog dialog = new Microsoft.Win32.OpenFileDialog();
- dialog.Title = "请选择文件路径";
- dialog.Filter =
- "All Image Files|*.bmp;*.ico;*.gif;*.jpeg;*.jpg;*.png;*.tif;*.tiff|"+"Windows Bitmap(*.bmp)|*.bmp|"+
- "Windows Icon(*.ico)|*.ico|"+
- "Graphics Interchange Format (*.gif)|(*.gif)|"+
- "JPEG File Interchange Format (*.jpg)|*.jpg;*.jpeg|"+
- "Portable Network Graphics (*.png)|*.png|"+
- "Tag Image File Format (*.tif)|*.tif;*.tiff";
- if (dialog.ShowDialog() ==true)
- {
- //this.Tag = dialog.FileName;
- //string foldPath =Path.GetFileName(dialog.FileName);
- if (this.DataContext is Property property)
- {
- property.Value = dialog.FileName;
- property.ExtendClickInvoke();
- }
- }
- }
- private void Hyperlink_OnClick(object sender, RoutedEventArgs e)
- {
- if (this.DataContext is Property property)
- {
- property.ItemClickInvoke();
- }
- }
- }
- }
|