예제 #1
0
        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 { }
        }
예제 #2
0
        public void UnInitializeControl()
        {
            if (root != null && rootParent != null)
            {
                Conductor.Beat -= Conductor_Beat;
                //rootParent.PointerPressed -= rootParent_PointerPressed;
                rootParent.ManipulationDelta -= rootParent_ManipulationDelta;

                layerState = null;
                layerStoryboard.Stop();
            }
        }
예제 #3
0
        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 { }
        }
예제 #4
0
        public void UnInitializeControl()
        {
            if (root != null && rootParent != null)
            {
                Conductor.Beat -= Conductor_Beat;
                //rootParent.PointerPressed -= rootParent_PointerPressed;
                rootParent.ManipulationDelta -= rootParent_ManipulationDelta;

                layerState = null;
                layerStoryboard.Stop();
            }
        }