Example #1
0
        public void TwoDialogsOpen_CloseDialog_FirstOpenDialogActive()
        {
            var fakeDialog1 = new FakeDialog();
            var fakeDialog2 = new FakeDialog();
            var dialogHost  = new DialogHost();

            dialogHost.OpenDialog(fakeDialog1);
            dialogHost.OpenDialog(fakeDialog2);
            Assert.Equal(fakeDialog2, dialogHost.ActiveDialog);

            dialogHost.CloseDialog();

            Assert.Equal(fakeDialog1, dialogHost.ActiveDialog);
        }
Example #2
0
        public void TwoDialogsOpen_CloseDialogTwice_NoActiveDialog()
        {
            var fakeDialog1 = new FakeDialog();
            var fakeDialog2 = new FakeDialog();
            var dialogHost  = new DialogHost();

            dialogHost.OpenDialog(fakeDialog1);
            dialogHost.OpenDialog(fakeDialog2);
            Assert.Equal(fakeDialog2, dialogHost.ActiveDialog);

            dialogHost.CloseDialog();
            dialogHost.CloseDialog();

            Assert.Null(dialogHost.ActiveDialog);
        }
Example #3
0
        public void OpenDialog_DialogActive()
        {
            var fakeDialog = new FakeDialog();
            var dialogHost = new DialogHost();

            dialogHost.OpenDialog(fakeDialog);

            Assert.Equal(fakeDialog, dialogHost.ActiveDialog);
        }
Example #4
0
        public void OpenDialog_ActiveDialogHostSetToThis()
        {
            var fakeDialog = new FakeDialog();
            var dialogHost = new DialogHost();

            dialogHost.OpenDialog(fakeDialog);

            Assert.Equal(dialogHost, fakeDialog.CurrentDialogHost);
        }
Example #5
0
        public void DialogOpen_CloseDialog_NoDialogActive()
        {
            var fakeDialog = new FakeDialog();
            var dialogHost = new DialogHost();

            dialogHost.OpenDialog(fakeDialog);
            Assert.Equal(fakeDialog, dialogHost.ActiveDialog);

            dialogHost.CloseDialog();

            Assert.Null(dialogHost.ActiveDialog);
        }
Example #6
0
 /// <summary>
 ///     Opens the dialog with a dialogIdentifier.
 /// </summary>
 /// <param name="dialogIdentifier">Dialog identifier object to be used</param>
 protected void Open(object dialogIdentifier)
 {
     DialogHost.OpenDialog(this, dialogIdentifier, DialogOpenedEventHandler);
 }
Example #7
0
 /// <summary>
 ///     Opens the dialog.
 /// </summary>
 protected void Open()
 {
     DialogHost.OpenDialog(this, DialogOpenedEventHandler);
 }