[feat:] added "new file" button for wiki and therefore
implemented the usage of NamingWindow
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user