[feat:] added "new file" button for wiki and therefore

implemented the usage of NamingWindow
This commit is contained in:
Elias Fierke
2026-01-18 16:15:25 +01:00
parent d478fd5129
commit 5172de332c
2 changed files with 19 additions and 3 deletions

View File

@@ -15,11 +15,11 @@ public partial class MainWindow : Window
public static MainWindow _instance;
private Country _selectedCountry;
private string _selectedWikiFilePath;
private bool _suppressCountryRefresh;
private WikiService _wikiService;
public Uri filePath;
private string _selectedWikiFilePath;
public MainWindow()
{
@@ -872,4 +872,19 @@ public partial class MainWindow : Window
new List<string> { countryie.ThreeLetterCode, countryie.TwoLetterCode }));
RefreshCountryView();
}
private async void BtnWikiAddFile_OnClick(object? sender, RoutedEventArgs e)
{
var result = await NamingWindow.Show(this);
if (result != null)
try
{
File.WriteAllText(Path.Combine(Global._instance.wiki_storage_path, result), "");
PopulateNavTree();
}
catch (Exception ex)
{
MessageBox.Show(this, ex.StackTrace, "Fehler");
}
}
}