SurfaceButton Class
TOC
Collapse the table of content
Expand the table of content

SurfaceButton Class



Represents a standard button that users can touch to activate an associated action.

Namespace: Microsoft.Surface.Presentation.Controls
Assembly: Microsoft.Surface.Presentation (in Microsoft.Surface.Presentation)

'Usage

public class SurfaceButton : Button
public class SurfaceButton extends Button
public class SurfaceButton extends Button

The following code example demonstrates how to attach an event handler to a SurfaceButton control using XAML markup.

For more information, see SurfaceButton Control.


<s:SurfaceButton Name="OpenButton" Content="Open" Click="OpenButton_Click"/>

The following code example demonstrates how to attach an event handler to a SurfaceButton control using code.


OpenButton.Click += new RoutedEventHandler(OpenButton_Click);

private void OpenButton_Click(object sender, RoutedEventArgs e)
{
    // Handle the action for the click here.
}

To provide functionality to a SurfaceButton control, you must attach an event handler to the Click event.


System.Object
   System.Windows.Threading.DispatcherObject
     System.Windows.DependencyObject
       System.Windows.Media.Visual
         System.Windows.UIElement
           System.Windows.FrameworkElement
             System.Windows.Controls.Control
               System.Windows.Controls.ContentControl
                 System.Windows.Controls.Primitives.ButtonBase
                   System.Windows.Controls.Button
                    Microsoft.Surface.Presentation.Controls.SurfaceButton

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

 

Requirements

Operating System (OS)Windows 7
Software Developer Kit (SDK)Surface 2.0
.NET Framework 4
Developer environmentVisual Studio 2010, Express or full edition
Microsoft Expression Blend 4.0 (optional)
End-user hardwareDevices made for Surface 2.0, or
Windows Touch computers

Did you find this information useful? Please send us your suggestions and comments.

© Microsoft Corporation. All rights reserved.
Show:
© 2016 Microsoft