public void ShowCustomMessageDialog(string title, string text) { _toolbarExtensions = (from e in ToolbarExtensionManager.Instance.Extensions where e.ViewModel.IsEnabled select e).ToList(); _customMessageDialogVm.Title = title; _customMessageDialogVm.Text = text; _customMessageDialog.DataContext = _customMessageDialogVm; _customMessageDialog.Show(); }
public static void ShowDialogAsync(string msg, bool isModeDialog = false) { //var dialog = new MessageDialogView() //{ // Message = { Text = msg }, //}; CustomMessageDialog customMessageDialog = new CustomMessageDialog() { Message = { Text = msg }, }; //await DialogHost.Show(dialog, "rootDialog"); if (isModeDialog) { customMessageDialog.ShowDialog(); } else { customMessageDialog.Show(); } }
public static bool Init(string[] args) { string appName = Assembly.GetExecutingAssembly().GetName().Name; // check gtk if (!ThemeHelper.CheckGtk()) { return(false); } ThemeHelper.ApplyCustomTheme(args); // init gtk app Application.Init(appName, ref args); // check windows platform if (!Gui.PlatformUtils.IsWindows) { CustomMessageDialog dlg = new CustomMessageDialog( null, MessageType.Error, "Your OS is not supported on this version!"); dlg.Ok += (sender, e) => Application.Quit(); dlg.Show(); Application.Run(); return(false); } // load dgle IEngineCore pEngineCore = null; if (!Engine.GetEngine(DLL_PATH, out pEngineCore)) { CustomMessageDialog dlg = new CustomMessageDialog( null, MessageType.Error, "Couldn't load \"{0}\"!", DLL_NAME); dlg.Ok += (sender, e) => Application.Quit(); dlg.Show(); Application.Run(); return(false); } Core = pEngineCore; // init dgle with force no window TEngineWindow eng_win = new TEngineWindow(); Core.InitializeEngine( IntPtr.Zero, appName, ref eng_win, 33, E_ENGINE_INIT_FLAGS.EIF_FORCE_NO_WINDOW | E_ENGINE_INIT_FLAGS.EIF_NO_SPLASH); //Core.ConsoleVisible(false); // init virtual file systems from dgle try { Packer.Init(); } catch { CustomMessageDialog dlg = new CustomMessageDialog( null, MessageType.Error, ButtonsType.Ok, "Failed to load file systems from DGLE!"); dlg.Ok += (sender, e) => Program.Stop(); dlg.Show(); return(false); } // init main win MainWindow win = new MainWindow(); win.Show(); win.DeleteEvent += (o, a) => { Stop(); a.RetVal = true; }; return(true); }