Button 按下按钮&;上升事件

Button 按下按钮&;上升事件,button,event-handling,windows-phone-8,Button,Event Handling,Windows Phone 8,我刚开始开发WindowsPhone8。 在正常的winforms中,我可以做OnMouseDown和OnMouseUp 这将如何转化为WP8开发?如果按下按钮,我需要触发一些事件;如果释放按钮,我需要触发一些其他事件?请根据您的要求尝试manipultionstarted和manipulationcompleted事件 public MainPage() { InitializeComponent(); butto

我刚开始开发WindowsPhone8。 在正常的winforms中,我可以做OnMouseDown和OnMouseUp


这将如何转化为WP8开发?如果按下按钮,我需要触发一些事件;如果释放按钮,我需要触发一些其他事件?

请根据您的要求尝试manipultionstarted和manipulationcompleted事件

        public MainPage()
        {
            InitializeComponent();
            button.ManipulationStarted += button_ManipulationStarted;
            button.ManipulationCompleted += button_ManipulationCompleted;         
        }

        void button_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
        {
            textblock.Text += "\n mouse button up";
        }

        void button_ManipulationStarted(object sender, System.Windows.Input.ManipulationStartedEventArgs e)
        {
            textblock.Text += "\n mouse button down";
        }

我刚刚使用了MouseLeftButtonDown和MouseLeftButtonUp事件