WPF固定文件夹目录

时间:2015-11-19 19:08:21

标签: c# wpf

我可以使用Winform中的这些代码打开Debug文件夹中的Images文件夹。我怎么能用WPF做到这一点?谢谢

openFile.InitialDirectory = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), @"Images");

1 个答案:

答案 0 :(得分:2)

您仍然可以使用GridViewTextBoxColumn yazarColumn = new GridViewTextBoxColumn("UniqueNameYazarColumn"); yazarColumn.Name = "UniqueNameYazarColumn"; textBoxColumn.HeaderText = "Your header"; textBoxColumn.FieldName = "yazar"; //Field is name of the bounded property of source //add column to the grid MyRadGridView.Columns.Add(yazarColumn); 。您只需要一种获取可执行路径的不同方法。这可以通过反思来完成。

Path.Combine