c# - Change the default message in the Security warning prompt when adding the DefaultFileName property of SaveFileDialog in Silverlight5 -
i using silverlight5 , need save file application. when user clicks save button, should open savefiledialog default name. using 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 problem is, when adding defaultfilename property savefiledialog, show automatically confirmation message window. need customize message in messagebox shown when open savefiledialog.
hope of may come across problem, please guide me overcome one.
please find image below
you can't. message generated plugin native implementation, if want override message; you'd need create own silverlight plugin :)
proof (from reflection of system.windows.dll)
// system.windows.controls.savefiledialog private bool? showdialoginternal(window owner) { ... // call native plugin api show save dialog num = xcpimports.ui_getsavefilename(nativehost.current.runtimehost, ref this.m_dlginfo, out dialogresult); if (nativemethods.succeeded(num) && this.m_dlginfo.lpstrfile != intptr.zero && dialogresult == dialogresult.ok) { // if went ok, have handle saved file ... } ... }
that being said - dialog can shut off if configure browser trust app. check out connect issue questioning validity of dialog:
https://connect.microsoft.com/visualstudio/feedback/details/690502/savefiledialog-security-warning
Comments
Post a Comment