I am using Silverlight5 and I just need to save a file from my Application. When user clicks the save button, it should open the SaveFileDialog with a default name. Using the following code:
private void Button_Click(object sender, RoutedEventArgs e)
{
SaveFileDialog dialog = new SaveFileDialog
{
DefaultExt = "xls",
Filter =
String.Format("{1} files (*.{0})|*.{0}|All files (*.*)|*.*", "xls", "Excel"
),
FilterIndex = 1,
DefaultFileName = "Test",
};
dialog.ShowDialog();
}
But the problem is, when we are adding DefaultFileName property to SaveFileDialog, it will show automatically a confirmation message window. I need to customize the message in the MessageBox shown when open SaveFileDialog.
Hope some of you may come across this problem, please guide me to overcome this one.
Please find the image below
You can't. This message is generated by the plugin native implementation, so if you want to override this message; you'd need to create your very own silverlight plugin :)
Proof (from reflection of System.Windows.dll)
That being said - this dialog can be shut off if you configure your browser to trust your app. Also check out this connect issue questioning the validity of this dialog:
https://connect.microsoft.com/VisualStudio/feedback/details/690502/savefiledialog-security-warning