I'm trying to create a save button with the SaveFileDialog in C# with UWP and XAML.
I tried to import Microsoft.Win32 like this post said, but it's not working. The SaveFileDialog() function tells me:
Error CS0234 The type or namespace name 'SaveFileDialog' does not exist in the namespace 'Microsoft.Win32' (are you missing an assembly reference?)
This is my code:
Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
dlg.FileName = "Document";
dlg.DefaultExt = ".txt";
dlg.Filter = "Text documents (.txt)|*.txt";
How can I fix this?