public void OnAlertFromLeftButtonClicked()
    {
        DialogAlert dialog = DialogManager.CreateAlert();

        dialog.Initialize("Example with a dialog animation that comes from the left", null, "OK", "Alert!", MaterialIconHelper.GetRandomIcon(), null, null);
        dialog.dialogAnimator = new DialogAnimatorSlide(0.5f, DialogAnimatorSlide.SlideDirection.Left, DialogAnimatorSlide.SlideDirection.Right);
        dialog.Show();
    }
Beispiel #2
0
        private void execute <Object>(Object obj)
        {
            string st = obj as string;

            switch (st)
            {
            case "MainMenu":
            {
                if (T_Helper.user.thisUser == null)
                {
                    UserControlsModule.NavigateContent("Login");
                }
                else
                {
                    UserControlsModule.NavigateContent("MainMenu");
                }
            }
            break;

            case "Settings":
            {
                UserControlsModule.NavigateContent("Settings");
            }
            break;

            case "Logout":
            {
                T_Helper.user.thisUser = null;
                Send("Logout");
                UserControlsModule.NavigateContent("Login");
            }
            break;

            case "Close":
            {
                DialogAlert.exitYasNo();
            }
            break;

            default: break;
            }
        }
    public void OnAlertFromLeftButtonClicked()
    {
        DialogAlert dialog = DialogManager.CreateAlert();

        dialog.Initialize("Example with a dialog animation that comes from the left", null, "OK", "Alert!", MaterialIconHelper.GetRandomIcon(), null, null);

        var oldAnimator = dialog.GetComponent <AbstractTweenBehaviour>() as Component;

        if (oldAnimator != null)
        {
            Object.DestroyImmediate(oldAnimator);
        }

        var animator = dialog.gameObject.AddComponent <EasyFrameAnimator>();

        animator.slideIn           = true;
        animator.slideInDirection  = ScreenView.SlideDirection.Left;
        animator.slideOut          = true;
        animator.slideOutDirection = ScreenView.SlideDirection.Left;

        dialog.Show();
    }
Beispiel #4
0
    static public DialogAlert ShowDialog(string text, Action yesAction, string yesText, Action cancelAction, string cancelText)
    {
        if (dialogAlert != null)
        {
            dialogAlert.Hide();
        }

        DialogAlert dialog = DialogManager.CreateAlert();

        dialog.Initialize(text, yesAction, yesText, null, null, cancelAction, cancelText);

        var animator = new DialogAnimatorSlide(0.2f, DialogAnimatorSlide.SlideDirection.Left, DialogAnimatorSlide.SlideDirection.Right);

        animator.backgroundAlpha = 0f;

        dialog.dialogAnimator = animator;
        dialog.ShowModal();

        // 保证单实例
        dialogAlert = dialog;

        return(dialogAlert);
    }
Beispiel #5
0
        private void execute <Object>(Object obj)
        {
            string st = obj as string;

            switch (st)
            {
            case "PageBefore":
            {
                PageThis--;
                Search();
            }
            break;

            case "PageNext":
            {
                PageThis++;
                Search();
            }
            break;

            case "Add":
            {
                VisibilityTableEdit_Visible();
                TableUsersEditViewModel.Send(null);
            }
            break;

            case "Edit":
            {
                VisibilityTableEdit_Visible();
                if (DataGridSelectedItem != null)
                {
                    TableUsersEditViewModel.Send(DataGridSelectedItem);
                }
            }
            break;

            case "Delete":
            {
                try
                {
                    var delete = DialogAlert.Delete();
                    if (delete == MessageBoxResult.OK)
                    {
                        if (DataGridSelectedItem != null)
                        {
                            T_Helper.user.Delete(F_File.GetPropertyInt(DataGridSelectedItem, "ID"));
                        }
                    }
                }
                catch (Exception e)
                {
                    F_File.LogError(e);
                    DialogError.Error();
                }
                Search();
            }
            break;

            //********************************************************************
            case "OverlayGridCancel":
            {
                Visibility_Collapsed();
            }
            break;

            default: break;
            }
        }
Beispiel #6
0
        private void execute <Object>(Object obj)
        {
            string st = obj as string;

            switch (st)
            {
            case "PageBefore":
            {
                PageThis--;
                Search();
            }
            break;

            case "PageNext":
            {
                PageThis++;
                Search();
            }
            break;

            case "Add":
            {
                VisibilityTableEdit_Visible();
                TableWholesalerEditViewModel.Send(null);
            }
            break;

            case "Edit":
            {
                VisibilityTableEdit_Visible();
                if (DataGridSelectedItem != null)
                {
                    TableWholesalerEditViewModel.Send(DataGridSelectedItem);
                }
            }
            break;

            case "Delete":
            {
                try
                {
                    var delete = DialogAlert.Delete();
                    if (delete == MessageBoxResult.OK)
                    {
                        if (DataGridSelectedItem != null)
                        {
                            T_Helper.wholesaler.Delete(F_File.GetPropertyInt(DataGridSelectedItem, "ID"));
                        }
                    }
                }
                catch (Exception e)
                {
                    F_File.LogError(e);
                    DialogError.Error();
                }
                Search();
            }
            break;

            case "MouseDoubleClick":
            {
                if (DataGridSelectedItem != null)
                {
                    int wholesaler_id = F_File.GetPropertyInt(DataGridSelectedItem, "ID");
                    if (ReceiverFrom == KeyStatic.class_.InvoicePurchaseViewModel)
                    {
                        InvoicePurchaseViewModel.Send(new KeyValuePair <string, int>(KeyStatic.view_.wholesaler_id, wholesaler_id));
                        ReceiverFrom = "";
                    }
                    else
                    {
                        MessageBox.Show("ReceiverFrom: error: " + ReceiverFrom);
                    }
                }
            }
            break;

            //********************************************************************
            case "OverlayGridCancel":
            {
                Visibility_Collapsed();
            }
            break;

            default: break;
            }
        }