private void CreatePopup(VisualStateTransitionSceneNode transitionNode) { VisualStateManagerSceneNode.EnsureExtendedAssemblyReferences((ITypeResolver)transitionNode.ProjectContext, transitionNode.DesignerContext.AssemblyService, transitionNode.DesignerContext.ViewUpdateManager); IType type = transitionNode.ProjectContext.ResolveType(ProjectNeutralTypes.TransitionEffect); if (transitionNode.ProjectContext.PlatformMetadata.IsNullType((ITypeId)type)) { return; } transitionNode.ViewModel.TransitionSelectionSet.SetSelection(transitionNode); SceneNodeProperty transitionEffectProperty = new VisualStateTransitionEditor(transitionNode).VisualTransitionObjectSet.CreateSceneNodeProperty(new PropertyReference((ReferenceStep)transitionNode.ProjectContext.ResolveProperty(VisualStateManagerSceneNode.TransitionEffectProperty)), TypeUtilities.GetAttributes(type.RuntimeType)); this.popup = new TransitionEffectPickerPopup(transitionEffectProperty, transitionNode.ViewModel.DefaultView); transitionNode.ViewModel.Closing += new EventHandler(this.ViewModel_Closing); this.popup.SynchronousClosed += (EventHandler)((sender, e) => { if (transitionNode.IsAttached && transitionNode.ViewModel != null) { transitionNode.ViewModel.TransitionSelectionSet.Clear(); } if (transitionEffectProperty != null) { transitionEffectProperty.OnRemoveFromCategory(); transitionEffectProperty = (SceneNodeProperty)null; } transitionNode.ViewModel.Closing -= new EventHandler(this.ViewModel_Closing); this.popup = (TransitionEffectPickerPopup)null; }); this.popup.Placement = PlacementMode.Bottom; this.popup.PlacementTarget = (UIElement)this; this.popup.IsOpen = true; }
private void ViewModel_Closing(object sender, EventArgs e) { if (this.popup == null) { return; } this.popup.IsOpen = false; this.popup = (TransitionEffectPickerPopup)null; }
void IComponentConnector.Connect(int connectionId, object target) { if (connectionId == 1) { this.TransitionEffectPickerPopupEditor = (TransitionEffectPickerPopup)target; } else { this._contentLoaded = true; } }