private void OpenMyLayerWinCommandClick() { var dd = new Demo1(); dd.Width = 500; dd.Height = 300; var vm = new Demo1ViewModel(); //设置20秒后关闭弹出窗体 MyTime.SetTimeout(10000, () => { ClosePopup.Request(); }); MyLayerServices.ShowDialog("Demo1", dd, vm, OnDialogCloseCallBack, new MyLayerOptions() { MaskBrush = SolidColorBrushConverter.From16JinZhi("#4F000000"), CanDrag = IsCandrag, HasShadow = HasShadow, AnimationType = SelectedAnimationType.Key }, delegate//窗体呈现完毕后执行的委托方法 { vm.Load(); }, ClosePopup//后台要关闭弹出窗口,只需要执行此InteractionRequest的Request()方法 ); }
public void RequestShouldRaiseEvent() { // arrange var expected = new Interaction(); var request = new InteractionRequest<Interaction>(); Interaction actual = null; request.Requested += ( s, e ) => actual = e.Interaction; // act request.Request( expected ); // assert Assert.Same( expected, actual ); }
public void Request(T instance) { _saveDialogRequest.Request(instance); }