Ejemplo n.º 1
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            _viewBox = Template.FindName("PART_VIEWBOX", this) as FrameworkElement;

            if (IsManipulable)
            {
                _manipulable = new Manipulable()
                {
                    Container = _parent
                };
                TapBehavior _tapbehavior = new TapBehavior()
                {
                    Threshold = 5
                };
                _manipulable.SupportedManipulations = ManipulationTypes.All;

                _manipulable.Manipulate += new EventHandler <ManipulationDeltaEventArgs>(_manipulable_Manipulate);
                _tapbehavior.Tap        += new EventHandler <TapEventArgs>(_tapbehavior_DoubleTap);

                BehaviorCollection bCollection = Interaction.GetBehaviors(this);
                bCollection.Add(_manipulable);
                bCollection.Add(_tapbehavior);
            }
        }
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            _viewBox = Template.FindName("PART_VIEWBOX", this) as FrameworkElement;

            if (IsManipulable)
            {
                _manipulable = new Manipulable() { Container = _parent };
                TapBehavior _tapbehavior = new TapBehavior() { Threshold= 5};
                _manipulable.SupportedManipulations = ManipulationTypes.All;

                _manipulable.Manipulate += new EventHandler<ManipulationDeltaEventArgs>(_manipulable_Manipulate);
                _tapbehavior.Tap += new EventHandler<TapEventArgs>(_tapbehavior_DoubleTap);

                BehaviorCollection bCollection = Interaction.GetBehaviors(this);
                bCollection.Add(_manipulable);
                bCollection.Add(_tapbehavior);
            }
        }