Skip to content

Commit a562af5

Browse files
committed
修复没有写入文件
1 parent 63b2ec4 commit a562af5

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

  • demo/DocumentFormat.OpenXml.Flatten.Demo/WPF/OpenXmlFlattenMauiForWpfDemo

demo/DocumentFormat.OpenXml.Flatten.Demo/WPF/OpenXmlFlattenMauiForWpfDemo/MainWindow.xaml.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,23 @@ private void MainWindow_Loaded(object sender, RoutedEventArgs e)
3333
var folder = System.IO.Path.GetDirectoryName(GetType().Assembly.Location)!;
3434
var testFile = System.IO.Path.Combine(folder, @"TestFiles\Shape Triangle.pptx");
3535

36-
if (File.Exists(testFile))
37-
{
38-
PaintBoardUserControl.Open(new FileInfo(testFile));
39-
}
36+
Open(testFile);
4037
}
4138

4239
private void OpenPptxFileButton_OnClick(object sender, RoutedEventArgs e)
4340
{
4441
var pptxFilePath = PptxFilePathTextBox.Text;
4542

43+
Open(pptxFilePath);
44+
}
45+
46+
private void Open(string pptxFilePath)
47+
{
4648
if (!string.IsNullOrEmpty(pptxFilePath) && File.Exists(pptxFilePath))
4749
{
4850
PaintBoardUserControl.Open(new FileInfo(pptxFilePath));
51+
52+
PptxFilePathTextBox.Text = pptxFilePath;
4953
}
5054
}
5155
}

0 commit comments

Comments
 (0)