private void InitializeControl() { try { if (root == null) { root = (Canvas)GetTemplateChild("root"); layerStoryboard = (Storyboard)root.Resources["layerStoryboard"]; layerAnimationX = (DoubleAnimation)layerStoryboard.Children[0]; layerAnimationY = (DoubleAnimation)layerStoryboard.Children[1]; layerState = new LayerState(SensitivityX, SensitivityY); Conductor.Beat += Conductor_Beat; rootParent = (Canvas)this.Parent; //rootParent.PointerPressed += rootParent_PointerPressed; rootParent.ManipulationDelta += rootParent_ManipulationDelta; rootParent.ManipulationMode = this.ManipulationMode; // &ManipulationModes.TranslateY; } } catch { } }
public void UnInitializeControl() { if (root != null && rootParent != null) { Conductor.Beat -= Conductor_Beat; //rootParent.PointerPressed -= rootParent_PointerPressed; rootParent.ManipulationDelta -= rootParent_ManipulationDelta; layerState = null; layerStoryboard.Stop(); } }
private void InitializeControl() { try { if (root == null) { root = (Canvas)GetTemplateChild("root"); layerStoryboard = (Storyboard)root.Resources["layerStoryboard"]; layerAnimationX = (DoubleAnimation)layerStoryboard.Children[0]; layerAnimationY = (DoubleAnimation)layerStoryboard.Children[1]; layerState = new LayerState(SensitivityX, SensitivityY); Conductor.Beat += Conductor_Beat; rootParent = (Canvas)this.Parent; //rootParent.PointerPressed += rootParent_PointerPressed; rootParent.ManipulationDelta += rootParent_ManipulationDelta; rootParent.ManipulationMode = this.ManipulationMode; // &ManipulationModes.TranslateY; } } catch { } }
public void UnInitializeControl() { if (root != null && rootParent != null) { Conductor.Beat -= Conductor_Beat; //rootParent.PointerPressed -= rootParent_PointerPressed; rootParent.ManipulationDelta -= rootParent_ManipulationDelta; layerState = null; layerStoryboard.Stop(); } }