Using Touch Support with a Menu Bar
Spread WinRT Documentation > Developer's Guide > Using Touch Support with the Component > Using Touch Support > Using Touch Support with a Menu Bar

You can use the AppBar with GcSpreadSheet.

Using Code

This example displays the AppBar.

CS
Copy Code

<Page.BottomAppBar>
    <AppBar x:Name="appBar">
    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
    <Button Content="Cut" Click="OnCutButtonClick" />
    </StackPanel>
   </AppBar>
</Page.BottomAppBar>


    private void gcSpreadSheet1_TouchToolbarOpening(object sender, GrapeCity.Xaml.SpreadSheet.UI.TouchToolbarOpeningEventArgs e)
        {
            this.appBar.IsOpen = true;
        }

void OnCutButtonClick(object sender, RoutedEventArgs e)
        {
            GrapeCity.Xaml.SpreadSheet.UI.ActionEventArgs actionArgs = new GrapeCity.Xaml.SpreadSheet.UI.ActionEventArgs();
            GrapeCity.Xaml.SpreadSheet.UI.SpreadActions.ClipboardCutFloatingObjects(this.gcSpreadSheet1.View, actionArgs);
            if (!actionArgs.Handled)
            {
                GrapeCity.Xaml.SpreadSheet.UI.SpreadActions.Cut(this.gcSpreadSheet1.View, new GrapeCity.Xaml.SpreadSheet.UI.ActionEventArgs());

            }
            this.appBar.IsOpen = false;
        }
        
    }

VB
Copy Code

<Page.BottomAppBar>
    <AppBar x:Name="appBar">
    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
    <Button Content="Cut" Click="OnCutButtonClick" />
    </StackPanel>
   </AppBar>
</Page.BottomAppBar>

Private Sub GcSpreadSheet1_TouchToolbarOpening(sender As Object, e As GrapeCity.Xaml.SpreadSheet.UI.TouchToolbarOpeningEventArgs) Handles GcSpreadSheet1.TouchToolbarOpening
        Me.appBar.IsOpen = True
    End Sub

    Private Sub OnCutButtonClick(sender As Object, e As RoutedEventArgs)
        Dim actionArgs As New GrapeCity.Xaml.SpreadSheet.UI.ActionEventArgs()
        GrapeCity.Xaml.SpreadSheet.UI.SpreadActions.ClipboardCutFloatingObjects(Me.GcSpreadSheet1.View, actionArgs)
        If Not actionArgs.Handled Then
            GrapeCity.Xaml.SpreadSheet.UI.SpreadActions.Cut(Me.GcSpreadSheet1.View, New GrapeCity.Xaml.SpreadSheet.UI.ActionEventArgs())
        End If
        Me.appBar.IsOpen = False
    End Sub
See Also