private async Task Delete(int id)
        {
            string deleteContent = localizer["Delete Content"];
            var    parameters    = new DialogParameters();

            parameters.Add("ContentText", string.Format(deleteContent, id));
            var options = new DialogOptions()
            {
                CloseButton = true, MaxWidth = MaxWidth.Small, FullWidth = true, DisableBackdropClick = true
            };
            var dialog = _dialogService.Show <Shared.Dialogs.DeleteConfirmation>("Delete", parameters, options);
            var result = await dialog.Result;

            if (!result.Cancelled)
            {
                var response = await _productManager.DeleteAsync(id);

                if (response.Succeeded)
                {
                    OnSearch("");
                    _snackBar.Add(localizer[response.Messages[0]], Severity.Success);
                }
                else
                {
                    OnSearch("");
                    foreach (var message in response.Messages)
                    {
                        _snackBar.Add(localizer[message], Severity.Error);
                    }
                }
            }
        }
        private async Task InvokeModal(int id = 0)
        {
            var parameters = new DialogParameters();

            if (id != 0)
            {
                var product = pagedData.FirstOrDefault(c => c.Id == id);
                parameters.Add("Id", product.Id);
                parameters.Add("Name", product.Name);
                parameters.Add("Description", product.Description);
                parameters.Add("Rate", product.Rate);
                parameters.Add("Brand", product.Brand);
                parameters.Add("BrandId", product.BrandId);
                parameters.Add("Barcode", product.Barcode);
            }
            var options = new DialogOptions()
            {
                CloseButton = true, MaxWidth = MaxWidth.Medium, FullWidth = true, DisableBackdropClick = true
            };
            var dialog = _dialogService.Show <AddEditProductModal>("Modal", parameters, options);
            var result = await dialog.Result;

            if (!result.Cancelled)
            {
                OnSearch("");
            }
        }
        private void listMenuView1_ItemPress(object sender, ListMenuViewItemPressEventArgs e)
        {
            switch (e.Item.Tag.ToString())
            {
            case "demoListViewRefresh":
                this.Show(new demoListViewRefresh());
                break;

            case "userFilter":
                //Dialog显示的自定义控件,如果重复使用,不需要每一次都实例化,如果需要实例化,记得把原来的给Destroy
                if (filter == null)
                {
                    //由于内部使用了Flex布局,需要在外部给定高度
                    filter           = new userFilter();
                    filter.Height    = 400;
                    filter.BackColor = System.Drawing.Color.White;
                    //最后一个参数代表支持点击空白处关闭
                    filterOptions = new DialogOptions(LayoutJustifyAlign.FlexEnd, System.Drawing.Color.FromArgb(128, 128, 128, 128), Padding.Empty, true);
                }
                this.ShowDialog(filter, filterOptions);
                break;

            case "userFooterDialog":
                //Dialog显示的自定义控件,如果重复使用,不需要每一次都实例化,如果需要实例化,记得把原来的给Destroy
                if (footerDialog == null)
                {
                    //由于内部控件都有了高度,所以userFooterDialog不用设置高度,会自动撑大
                    footerDialog = new SmobilerSamples.ShowDialog.userFooterDialog();
                    //最后一个参数代表支持点击空白处关闭
                    footerDialogOptions = new DialogOptions(LayoutJustifyAlign.FlexEnd, System.Drawing.Color.FromArgb(128, 128, 128, 128), Padding.Empty, true);
                }
                this.ShowDialog(footerDialog, footerDialogOptions);
                break;

            case "userDialogPassword":
                if (footerDialogOptions == null)
                {
                    footerDialogOptions = new DialogOptions(LayoutJustifyAlign.FlexEnd, System.Drawing.Color.FromArgb(128, 128, 128, 128), Padding.Empty, true);
                }
                ShowDialog.userDialogPassword dialogPassowrd = new ShowDialog.userDialogPassword();
                dialogPassowrd.DialogPassword += (pass) => { MessageBox.Show(pass); };
                this.ShowDialog(dialogPassowrd, footerDialogOptions);
                break;

            case "demogetdata":
                demogetdata dm = new demogetdata();
                dm.Selected += (obj, args) => { Toast(args.Text); };
                this.ShowDialog(dm);
                break;

            case "demoWebView":
                this.Show(new demoWebView());
                break;

            case "demoCustomResource":
                this.Show(new demoCustomResource());
                break;
            }
        }
Beispiel #4
0
        private void img_car_Press(object sender, EventArgs e)
        {
            TSBuyCar      car = new TSBuyCar();
            DialogOptions footerDialogOptions;

            footerDialogOptions = new DialogOptions(LayoutJustifyAlign.FlexEnd, System.Drawing.Color.FromArgb(128, 128, 128, 128), Smobiler.Core.Controls.Padding.Empty, true);
            ShowDialog(car, footerDialogOptions);
        }
 private void SetupButtons(DialogOptions options)
 {
     foreach (var result in EnumExtensions.GetValues <DialogResult>())
     {
         string name = $"{result.Name()}Button";
         SetupButton(name, result, options);
     }
 }
Beispiel #6
0
 public DynamicFormWrapper(object model, object context, DialogOptions options)
 {
     DataContext = options;
     InitializeComponent();
     Form.Environment.Add(options.EnvironmentFlags);
     Form.Context = context;
     Form.Model   = model;
 }
Beispiel #7
0
        private void imageButton2_Press(object sender, EventArgs e)
        {
            DialogOptions footerDialogOptions;

            footerDialogOptions = new DialogOptions(LayoutJustifyAlign.FlexEnd, System.Drawing.Color.FromArgb(128, 128, 128, 128), Smobiler.Core.Controls.Padding.Empty, true);
            ShowDialog(new LeaveTime(), footerDialogOptions);
            //   ShowDialog(new LeaveTime());
        }
Beispiel #8
0
        public Dialog(string name)
            : base(name)
        {
            Options = new DialogOptions()
                {

                };
        }
Beispiel #9
0
        public static bool?Show(string message, DialogIcon icon = DialogIcon.None, DialogOptions option = DialogOptions.Ok)
        {
            var dialog = new GenericMessageDialog(message, icon, option);

            dialog.Owner = Application.Current.MainWindow;

            return(dialog.ShowDialog());
        }
Beispiel #10
0
        public async Task <bool> ShowDialogAsync(DialogOptions options)
        {
            var component = new RenderComponent <DialogModal>().
                            Set(e => e.Options, options);
            var result = await ShowAsync("", component, new ModalOptions { Size = ModalSize.Small, ShowHeader = false, StatusColor = options.StatusColor });

            return(!result.Cancelled);
        }
Beispiel #11
0
    public Dialogue(GameObject person, string text)
    {
        DialogOptions options = person.GetComponent <DialogOptions>();

        this.person    = person;
        this.color     = options.color;
        this.fontColor = options.fontColor;
        this.text      = text;
    }
Beispiel #12
0
 private void btnUploadVoice_Press(object sender, EventArgs e)
 {
     if (dialogTraining == null)
     {
         dialogTrainingOptions             = new DialogOptions(LayoutJustifyAlign.Center);
         dialogTrainingOptions.TouchClosed = false;
         dialogTraining = new ctlSpeechTraining();
     }
     this.ShowDialog(dialogTraining, dialogTrainingOptions);
 }
Beispiel #13
0
 public async Task <dynamic> OpenAsync <T>(
     string title,
     Dictionary <string, object> parameters = null,
     DialogOptions options = null) where T : ComponentBase
 {
     return(await this.dialogService.OpenAsync <T>(
                title,
                parameters,
                options));
 }
Beispiel #14
0
        public static void InputDialog(this ICakeContext context, Action <DialogOptions> st)
        {
            var settings = new DialogOptions();

            st(settings);

            var dlg = new InputDialog(settings);

            dlg.ShowDialog();
        }
Beispiel #15
0
        /// <summary>
        /// Shows the <paramref name="contentView"/>.
        /// </summary>
        /// <param name="contentView"> The <see cref="Visual"/> to show. </param>
        /// <param name="buttonConfigurations"> The configurations for <see cref="Models.Button"/>s to show. </param>
        /// <param name="displayBehavior"> The <see cref="DialogDisplayBehavior"/> for showing the <paramref name="contentView"/>. </param>
        /// <param name="dialogOptions"> <see cref="DialogOptions"/> for the new <see cref="Dialog"/>. </param>
        /// <param name="cancellationToken"> An external <see cref="CancellationToken"/> used to cancel the dialog. </param>
        /// <returns> The <see cref="DialogTask"/> used to interact and await the shown view. </returns>
        internal DialogTask ShowView
        (
            Visual contentView,
            IEnumerable <ButtonConfiguration> buttonConfigurations,
            DialogDisplayBehavior displayBehavior,
            DialogOptions dialogOptions,
            CancellationToken cancellationToken
        )
        {
            if (cancellationToken.IsCancellationRequested)
            {
                return(DialogTask.Killed);
            }

            // If necessary, handle the currently displayed view.
            switch (displayBehavior)
            {
            case DialogDisplayBehavior.Show:
                break;

            case DialogDisplayBehavior.Override:
                this.RemoveTopMostView(DialogResult.Killed);
                break;
            }

            // Create buttons from the configuration.
            var buttons = buttonConfigurations
                          .Select(configuration => new Models.Button(configuration, this.Revoke))
                          .ToList()
            ;

            // Create a new dialog.
            var dialog = new Dialog
                         (
                contentView: contentView,
                buttons: buttons,
                closeCallback: this.Revoke,
                options: dialogOptions,
                externalCancellationToken: cancellationToken
                         );

            if (cancellationToken.IsCancellationRequested)
            {
                return(DialogTask.Killed);
            }

            // Save it.
            _dialogs.Push(dialog);

            // Show it.
            this.ShowView();

            // Return it.
            return(dialog.DialogTask);
        }
Beispiel #16
0
    protected async Task AddItemsToCollection(
        List <int> movieIds,
        List <int> showIds,
        List <int> seasonIds,
        List <int> episodeIds,
        List <int> artistIds,
        List <int> musicVideoIds,
        List <int> otherVideoIds,
        List <int> songIds,
        string entityName = "selected items")
    {
        int count = movieIds.Count + showIds.Count + seasonIds.Count + episodeIds.Count + artistIds.Count +
                    musicVideoIds.Count + otherVideoIds.Count + songIds.Count;

        var parameters = new DialogParameters
        {
            { "EntityType", count.ToString() }, { "EntityName", entityName }
        };
        var options = new DialogOptions {
            CloseButton = true, MaxWidth = MaxWidth.ExtraSmall
        };

        IDialogReference dialog = Dialog.Show <AddToCollectionDialog>("Add To Collection", parameters, options);
        DialogResult     result = await dialog.Result;

        if (!result.Cancelled && result.Data is MediaCollectionViewModel collection)
        {
            var request = new AddItemsToCollection(
                collection.Id,
                movieIds,
                showIds,
                seasonIds,
                episodeIds,
                artistIds,
                musicVideoIds,
                otherVideoIds,
                songIds);

            Either <BaseError, Unit> addResult = await Mediator.Send(request, CancellationToken);

            addResult.Match(
                Left: error =>
            {
                Snackbar.Add($"Unexpected error adding items to collection: {error.Value}");
                Logger.LogError("Unexpected error adding items to collection: {Error}", error.Value);
            },
                Right: _ =>
            {
                Snackbar.Add(
                    $"Added {count} items to collection {collection.Name}",
                    Severity.Success);
                ClearSelection();
            });
        }
    }
Beispiel #17
0
    private async Task NoticeClick(int id)
    {
        _errors = Array.Empty <string>();
        var errors = new List <string>();

        if (id > 0)
        {
            var notice = _notices !.SingleOrDefault(x => x.Id == id);
            if (notice is not null)
            {
                var parameters = new DialogParameters
                {
                    { "Model", notice }
                };
                var options = new DialogOptions
                {
                    DisableBackdropClick = true
                };
                var result = await _dialogService !.Show <NoticeDialog>(string.Empty, parameters, options).Result;
                if (result.Cancelled)
                {
                    var deleteresult = await _noticeService !.DeleteAsync(notice);
                    if (!deleteresult.Successful)
                    {
                        errors.Add(deleteresult.ErrorMessage());
                    }
                    else
                    {
                        MainLayout !.DecrementUnreadNoticeCount();
                    }
                }
                else
                {
                    if (!notice.Read)
                    {
                        var markreadresult = await _noticeService !.MarkReadAsync(id);
                        if (!markreadresult.Successful)
                        {
                            errors.Add(markreadresult.ErrorMessage());
                        }
                        else
                        {
                            MainLayout !.DecrementUnreadNoticeCount();
                        }
                    }
                }
                await LoadNotices(_user?.Id ?? 0);
            }
        }
        else
        {
            errors.Add(String.Format(Strings.Invalid, "notice id"));
        }
        _errors = errors.ToArray();
    }
        /// <summary>
        /// Ends the active dialog and starts a new dialog in its place. This is particularly useful
        /// for creating loops or redirecting to another dialog.
        /// </summary>
        /// <param name="dialogId">ID of the new dialog to start.</param>
        /// <param name="options">(Optional) additional argument(s) to pass to the new dialog.</param>
        /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
        public async Task <DialogTurnResult> ReplaceAsync(string dialogId, DialogOptions options = null)
        {
            // Pop stack
            if (Stack.Any())
            {
                Stack.RemoveAt(0);
            }

            // Start replacement dialog
            return(await BeginAsync(dialogId, options).ConfigureAwait(false));
        }
Beispiel #19
0
 /// <summary>
 /// Shows a message dialog.
 /// </summary>
 /// <param name="dialogManager"> The extended <see cref="IDialogManager"/>. </param>
 /// <param name="messageModels"> A collection of <see cref="MessageDialogModel"/>s for the dialog. </param>
 /// <param name="buttons"> The <see cref="DialogButtons"/> to display. Default is <see cref="DialogButtons.Ok"/>. </param>
 /// <param name="displayLocation"> The <see cref="DialogDisplayLocation"/> of the dialog. Default is <see cref="DialogDisplayLocation.Window"/>. </param>
 /// <param name="displayBehavior"> The <see cref="DialogDisplayBehavior"/> of the dialog. Default is <see cref="DialogDisplayBehavior.Show"/>. </param>
 /// <param name="dialogOptions"> The <see cref="DialogOptions"/> of the dialog. Default is <see cref="DialogOptions.None"/>. </param>
 /// <param name="cancellationToken"> An external <see cref="CancellationToken"/> used to cancel the dialog. </param>
 /// <returns> An awaitable <see cref="DialogTask"/>. </returns>
 public static DialogTask ShowMessage
 (
     this IDialogManager dialogManager,
     ICollection <MessageDialogModel> messageModels,
     DialogButtons buttons = DialogButtons.Ok,
     DialogDisplayLocation displayLocation = DialogDisplayLocation.Window,
     DialogDisplayBehavior displayBehavior = DialogDisplayBehavior.Show,
     DialogOptions dialogOptions           = DialogOptions.None,
     CancellationToken cancellationToken   = default
 )
 => dialogManager.ShowMessage(messageModels, DefaultButtonConfigurations.GetConfiguration(buttons), displayLocation, displayBehavior, dialogOptions, cancellationToken);
Beispiel #20
0
 /// <summary>
 /// Shows an exception dialog.
 /// </summary>
 /// <param name="dialogManager"> The extended <see cref="IDialogManager"/>. </param>
 /// <param name="title"> The title of the dialog. </param>
 /// <param name="message"> The message of the dialog. </param>
 /// <param name="displayLocation"> The <see cref="DialogDisplayLocation"/> of the dialog. Default is <see cref="DialogDisplayLocation.Window"/>. </param>
 /// <param name="displayBehavior"> The <see cref="DialogDisplayBehavior"/> of the dialog. Default is <see cref="DialogDisplayBehavior.Show"/>. </param>
 /// <param name="dialogOptions"> The <see cref="DialogOptions"/> of the dialog. Default is <see cref="DialogOptions.None"/>. </param>
 /// <param name="cancellationToken"> An external <see cref="CancellationToken"/> used to cancel the dialog. </param>
 /// <returns> An awaitable <see cref="DialogTask"/>. </returns>
 public static DialogTask ShowException
 (
     this IDialogManager dialogManager,
     string title   = null,
     string message = null,
     DialogDisplayLocation displayLocation = DialogDisplayLocation.Window,
     DialogDisplayBehavior displayBehavior = DialogDisplayBehavior.Show,
     DialogOptions dialogOptions           = DialogOptions.None,
     CancellationToken cancellationToken   = default
 )
 => dialogManager.ShowExceptions(new Exception[0], title, message, displayLocation, displayBehavior, dialogOptions, cancellationToken);
Beispiel #21
0
        public DialogResponse MessageBox(string message, DialogOptions options)
        {
            const GtkInterop.DialogFlags flags = GtkInterop.DialogFlags.GTK_DIALOG_MODAL;

            var type = GtkInterop.MessageType.GTK_MESSAGE_INFO;

            switch (options.Icon)
            {
            case DialogIcon.None:
                break;

            case DialogIcon.Question:
                type = GtkInterop.MessageType.GTK_MESSAGE_QUESTION;
                break;

            case DialogIcon.Information:
                type = GtkInterop.MessageType.GTK_MESSAGE_INFO;
                break;

            case DialogIcon.Warning:
                type = GtkInterop.MessageType.GTK_MESSAGE_WARNING;
                break;

            case DialogIcon.Error:
                type = GtkInterop.MessageType.GTK_MESSAGE_ERROR;
                break;
            }

            const GtkInterop.ButtonsType bt = GtkInterop.ButtonsType.GTK_BUTTONS_OK;

            var title    = GtkInterop.AllocGtkString(options.Title);
            var widget   = IntPtr.Zero;
            var response = GtkInterop.ResponseType.GTK_RESPONSE_OK;

            try
            {
                widget = GtkInterop.gtk_message_dialog_new(IntPtr.Zero, flags, type, bt, title, IntPtr.Zero);
                GtkInterop.gtk_message_dialog_format_secondary_text(widget, message);
                response = GtkInterop.gtk_dialog_run(widget);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
            finally
            {
                GtkInterop.gtk_widget_destroy(widget);
                GtkInterop.g_free(title);
            }

            return(new DialogResponse {
                IsCanceled = response == GtkInterop.ResponseType.GTK_RESPONSE_DELETE_EVENT
            });
        }
Beispiel #22
0
 /// <summary>
 /// Shows a warning dialog.
 /// </summary>
 /// <param name="dialogManager"> The extended <see cref="IDialogManager"/>. </param>
 /// <param name="messageModels"> A collection of <see cref="MessageDialogModel"/>s for the dialog. </param>
 /// <param name="buttonConfigurations"> A collection of custom <see cref="ButtonConfiguration"/> used to display buttons. </param>
 /// <param name="displayLocation"> The <see cref="DialogDisplayLocation"/> of the dialog. Default is <see cref="DialogDisplayLocation.Window"/>. </param>
 /// <param name="displayBehavior"> The <see cref="DialogDisplayBehavior"/> of the dialog. Default is <see cref="DialogDisplayBehavior.Show"/>. </param>
 /// <param name="dialogOptions"> The <see cref="DialogOptions"/> of the dialog. Default is <see cref="DialogOptions.None"/>. </param>
 /// <param name="cancellationToken"> An external <see cref="CancellationToken"/> used to cancel the dialog. </param>
 /// <returns> An awaitable <see cref="DialogTask"/>. </returns>
 public static DialogTask ShowWarning
 (
     this IDialogManager dialogManager,
     ICollection <MessageDialogModel> messageModels,
     IEnumerable <ButtonConfiguration> buttonConfigurations,
     DialogDisplayLocation displayLocation = DialogDisplayLocation.Window,
     DialogDisplayBehavior displayBehavior = DialogDisplayBehavior.Show,
     DialogOptions dialogOptions           = DialogOptions.None,
     CancellationToken cancellationToken   = default
 )
 => dialogManager.ShowMessage(new WarningDialogViewModel(messageModels), buttonConfigurations, displayLocation, displayBehavior, dialogOptions, cancellationToken);
Beispiel #23
0
 /// <summary>
 /// Shows a message dialog.
 /// </summary>
 /// <param name="dialogManager"> The extended <see cref="IDialogManager"/>. </param>
 /// <param name="messageModel"> The <see cref="MessageDialogModel"/> of the dialog. </param>
 /// <param name="buttons"> The <see cref="DialogButtons"/> to display. Default is <see cref="DialogButtons.Ok"/>. </param>
 /// <param name="displayLocation"> The <see cref="DialogDisplayLocation"/> of the dialog. Default is <see cref="DialogDisplayLocation.Window"/>. </param>
 /// <param name="displayBehavior"> The <see cref="DialogDisplayBehavior"/> of the dialog. Default is <see cref="DialogDisplayBehavior.Show"/>. </param>
 /// <param name="dialogOptions"> The <see cref="DialogOptions"/> of the dialog. Default is <see cref="DialogOptions.None"/>. </param>
 /// <param name="cancellationToken"> An external <see cref="CancellationToken"/> used to cancel the dialog. </param>
 /// <returns> An awaitable <see cref="DialogTask"/>. </returns>
 public static DialogTask ShowMessage
 (
     this IDialogManager dialogManager,
     MessageDialogModel messageModel,
     DialogButtons buttons = DialogButtons.Ok,
     DialogDisplayLocation displayLocation = DialogDisplayLocation.Window,
     DialogDisplayBehavior displayBehavior = DialogDisplayBehavior.Show,
     DialogOptions dialogOptions           = DialogOptions.None,
     CancellationToken cancellationToken   = default
 )
 => dialogManager.ShowMessage(new[] { messageModel }, buttons, displayLocation, displayBehavior, dialogOptions, cancellationToken);
 internal WaterfallStepContext(WaterfallDialog parent, DialogContext dc, DialogOptions options, IDictionary <string, object> values, int index, DialogReason reason, object result = null)
 {
     _parent     = parent;
     _dc         = dc;
     _nextCalled = false;
     Options     = options;
     Values      = values;
     Index       = index;
     Reason      = reason;
     Result      = result;
 }
Beispiel #25
0
        AutofacConfig autofacConfig = new AutofacConfig();//调用配置类
        #endregion
        /// <summary>
        /// 对当前行项区域进行编辑或删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void plEdit_Press(object sender, EventArgs e)
        {
            frmLocationRowsButtonLayout frm = new frmLocationRowsButtonLayout();

            frm.ID      = lblName.BindDataValue.ToString();    //区域编号
            frm.LocName = lblName.BindDisplayValue.ToString(); //区域名称
            DialogOptions dialog = new DialogOptions();

            dialog.JustifyAlign = LayoutJustifyAlign.FlexEnd;
            dialog.Padding      = new Padding(0);
            this.Form.ShowDialog(frm, dialog);
        }
Beispiel #26
0
 /// <summary>
 /// Shows an exception dialog.
 /// </summary>
 /// <param name="dialogManager"> The extended <see cref="IDialogManager"/>. </param>
 /// <param name="exception"> The <see cref="Exception"/> of the dialog. If this is an <see cref="AggregateException"/>, then the <see cref="AggregateException.InnerExceptions"/> collection will be used. </param>
 /// <param name="title"> The title of the dialog. </param>
 /// <param name="message"> The message of the dialog. </param>
 /// <param name="displayLocation"> The <see cref="DialogDisplayLocation"/> of the dialog. Default is <see cref="DialogDisplayLocation.Window"/>. </param>
 /// <param name="displayBehavior"> The <see cref="DialogDisplayBehavior"/> of the dialog. Default is <see cref="DialogDisplayBehavior.Show"/>. </param>
 /// <param name="dialogOptions"> The <see cref="DialogOptions"/> of the dialog. Default is <see cref="DialogOptions.None"/>. </param>
 /// <param name="cancellationToken"> An external <see cref="CancellationToken"/> used to cancel the dialog. </param>
 /// <returns> An awaitable <see cref="DialogTask"/>. </returns>
 public static DialogTask ShowException
 (
     this IDialogManager dialogManager,
     Exception exception,
     string title   = null,
     string message = null,
     DialogDisplayLocation displayLocation = DialogDisplayLocation.Window,
     DialogDisplayBehavior displayBehavior = DialogDisplayBehavior.Show,
     DialogOptions dialogOptions           = DialogOptions.None,
     CancellationToken cancellationToken   = default
 )
 => dialogManager.ShowExceptions(exception is AggregateException aggregateException ? aggregateException.InnerExceptions.ToArray() : new[] { exception }, title, message, displayLocation, displayBehavior, dialogOptions, cancellationToken);
 /// <inheritdoc />
 public DialogTask ShowContent
 (
     object viewModel,
     IEnumerable <ButtonConfiguration> buttonConfigurations,
     DialogDisplayLocation displayLocation = DialogDisplayLocation.Window,
     DialogDisplayBehavior displayBehavior = DialogDisplayBehavior.Show,
     DialogOptions dialogOptions           = DialogOptions.HideTransparencyToggle,
     CancellationToken cancellationToken   = default
 )
 {
     return(this.Show(viewModel, _wrappingViewProvider, buttonConfigurations, displayLocation, displayBehavior, dialogOptions, cancellationToken));
 }
Beispiel #28
0
        protected virtual DialogOptions GetDialogOptions()
        {
            DialogOptions opt = new DialogOptions();

            opt.DialogClass = "s-Dialog " + "s-" + this.GetType().Name;
            opt.Width       = 920;
            opt.AutoOpen    = false;
            opt.Resizable   = false;
            opt.Modal       = true;
            opt.Position    = new string[] { "center", "center" };

            return(opt);
        }
Beispiel #29
0
        private void SetupButton(string buttonName, DialogResult result, DialogOptions options)
        {
            var button = this.FindControl <Button>(buttonName);

            if (button is null)
            {
                return;
            }

            button.Command          = _buttonCommand;
            button.CommandParameter = result;
            button.IsVisible        = options.HasFlag((DialogOptions)(int)result);
        }
Beispiel #30
0
 /// <summary>
 /// Shows a message dialog.
 /// </summary>
 /// <param name="dialogManager"> The extended <see cref="IDialogManager"/>. </param>
 /// <param name="title"> The title of the dialog. </param>
 /// <param name="message"> The message of the dialog. </param>
 /// <param name="contentViewModel"> The inner content (view model) of the dialog. </param>
 /// <param name="buttons"> The <see cref="DialogButtons"/> to display. Default is <see cref="DialogButtons.Ok"/>. </param>
 /// <param name="displayLocation"> The <see cref="DialogDisplayLocation"/> of the dialog. Default is <see cref="DialogDisplayLocation.Window"/>. </param>
 /// <param name="displayBehavior"> The <see cref="DialogDisplayBehavior"/> of the dialog. Default is <see cref="DialogDisplayBehavior.Show"/>. </param>
 /// <param name="dialogOptions"> The <see cref="DialogOptions"/> of the dialog. Default is <see cref="DialogOptions.None"/>. </param>
 /// <param name="cancellationToken"> An external <see cref="CancellationToken"/> used to cancel the dialog. </param>
 /// <returns> An awaitable <see cref="DialogTask"/>. </returns>
 public static DialogTask ShowMessage
 (
     this IDialogManager dialogManager,
     string title            = null,
     string message          = null,
     object contentViewModel = null,
     DialogButtons buttons   = DialogButtons.Ok,
     DialogDisplayLocation displayLocation = DialogDisplayLocation.Window,
     DialogDisplayBehavior displayBehavior = DialogDisplayBehavior.Show,
     DialogOptions dialogOptions           = DialogOptions.None,
     CancellationToken cancellationToken   = default
 )
 => dialogManager.ShowMessage(new MessageDialogModel(identifier: null, title: title, message: message, contentViewModel: contentViewModel), buttons, displayLocation, displayBehavior, dialogOptions, cancellationToken);
Beispiel #31
0
 public static void ParseOpenChat(byte[] data)
 {
     _dialogTemp = new DialogOptions();
     using (var ms = new MemoryStream(data))
         using (var stream = new BinaryReader(ms, Encoding))
         {
             stream.ReadBytes(12);
             var conId = stream.ReadUInt32();
             if (_parsedNpcs.ContainsKey(conId))
             {
                 _lastNpcId = _parsedNpcs[conId].NpcId;
             }
         }
 }
        /// <summary>
        ///     Display a simple dialog with OK Button
        /// </summary>
        /// <param name="title"></param>
        /// <param name="message"></param>
        /// <param name="option"></param>
        public void ShowDialog(string title, string message, DialogOptions option)
        {
            var vm = DataContext as MainWindowViewModel;
            switch (option)
            {
                case DialogOptions.Normal:
                    vm?.ShowDialogOk(title, message);
                    break;

                case DialogOptions.Error:
                    vm?.ShowDialogError(title, message);
                    break;
            }
        }
Beispiel #33
0
///<summary>
///Creates a new instance of Dialog
///</summary>
public Dialog(JsString selector, DialogOptions options)
{
Selector = J(selector);
Selector.dialog(options);
}