protected override XmlElement VCreateInheritedElement(XmlElement baseElement) { var textureElement = baseElement.OwnerDocument.CreateElement("Texture"); textureElement.SetAttribute("resource", Texture); baseElement.AppendChild(textureElement); var animationElement = baseElement.OwnerDocument.CreateElement("Animation"); animationElement.SetAttribute("fx", FrameX.ToString(CultureInfo.InvariantCulture)); animationElement.SetAttribute("fy", FrameY.ToString(CultureInfo.InvariantCulture)); animationElement.SetAttribute("loop", Looping.ToString(CultureInfo.InvariantCulture)); if (Speed != null) { animationElement.SetAttribute("speed", Speed.ToString()); } if (StartFrame != null) { animationElement.SetAttribute("startFrame", StartFrame.ToString()); } if (EndFrame != null) { animationElement.SetAttribute("endFrame", EndFrame.ToString()); } if (m_SubAnimations.Count > 0) { animationElement.SetAttribute("defaultAnim", m_sDefaultAnim); } foreach (var subAnim in m_SubAnimations.Values) { var subAnimationNode = baseElement.OwnerDocument.CreateElement("SubAnimation"); subAnimationNode.SetAttribute("id", subAnim.ID); subAnimationNode.SetAttribute("speed", subAnim.Speed.ToString(CultureInfo.InvariantCulture)); subAnimationNode.SetAttribute("startFrame", subAnim.StartFrame.ToString(CultureInfo.InvariantCulture)); subAnimationNode.SetAttribute("endFrame", subAnim.EndFrame.ToString(CultureInfo.InvariantCulture)); animationElement.AppendChild(subAnimationNode); } baseElement.AppendChild(animationElement); var mirroredElement = baseElement.OwnerDocument.CreateElement("Mirrored"); mirroredElement.SetAttribute("status", Mirrored.ToString(CultureInfo.InvariantCulture)); baseElement.AppendChild(mirroredElement); var scriptElement = baseElement.OwnerDocument.CreateElement("OnEndScript"); scriptElement.SetAttribute("resource", OnEndScript); baseElement.AppendChild(scriptElement); return(baseElement); }
public void Show() { if (FrameX == null) { return; } FrameX.Attach(this); PopupRoot.Open(); ShowAnimation.Begin(); }
private void CreateRootFrame() { Frame rootFrame = Window.Current.Content as Frame; // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (rootFrame != null) { return; } // Create a Frame to act as the navigation context and navigate to the first page rootFrame = new FrameX(); rootFrame.NavigationFailed += OnNavigationFailed; // Place the frame in the current Window Window.Current.Content = rootFrame; CustomizeWindow(); }
private void CloseAnimation_OnCompleted(object sender, object e) { PopupRoot.Close(); FrameX?.Deattach(this); }