Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        public void OpenDialog_DialogActive()
        {
            var fakeDialog = new FakeDialog();
            var dialogHost = new DialogHost();

            dialogHost.OpenDialog(fakeDialog);

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

            dialogHost.OpenDialog(fakeDialog);

            Assert.Equal(dialogHost, fakeDialog.CurrentDialogHost);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 7
0
 /// <summary>
 ///     Opens the dialog.
 /// </summary>
 protected void Open()
 {
     DialogHost.OpenDialog(this, DialogOpenedEventHandler);
 }