Closed sebaJoSt closed 3 years ago
@sebaJoSt Assigning a string only works in XAML. In Code you can use the helper behind it like this:
dialog.Filters = MaterialDesignExtensions.Controllers.FileFilterHelper.ParseFileFilters("txt files (*.txt)|*.txt|All files (*.*)|*.*");
Creating a dialog on your own is a little bit tedious. See the demo of the specific helper methods for ease of use.
Thanks for your support. I got it working but I have another small issue:
OpenFileDialogArguments dialogArgs = new()
{
Width = 500,
Height = 500,
Filters = "License File|*.lic|All files (*.*)|*.*"
};
OpenFileDialogResult dialogResult = await OpenFileDialog.ShowDialogAsync("ActivationDialog", dialogArgs);
The open file dialog is shown within a dialog with DialogHost "ActivationDialog". This dialog is hosted by another host (MainWIndow DialogHost) and has a size of around 200 x 200px. Even if I change the Width & Height of OpenFileDialog to larger values, it is limited to the size of the ActivationDialog. However when I wrap the OpenFileControl in a dialog user control by myself, it works.
var dialog = new MaterialDesignExtensions.Controls.OpenFileDialog();
dialog.Filters = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
Error message: Cannot implicitly convert type 'string' to 'System.Collections.Generic.IList'
I think I'm doing it wrong.