Skip to content

Instantly share code, notes, and snippets.

@devjaime
Created April 17, 2019 05:13
Show Gist options
  • Select an option

  • Save devjaime/d9eb03a38b925351897e87c5155e910b to your computer and use it in GitHub Desktop.

Select an option

Save devjaime/d9eb03a38b925351897e87c5155e910b to your computer and use it in GitHub Desktop.
xamls
<views:BasePage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:Acelerometro.View"
xmlns:viewmodels="clr-namespace:Acelerometro.ViewModel"
x:Class="Acelerometro.View.AccelerometerPage"
Title="Accelerometer">
<views:BasePage.BindingContext>
<viewmodels:AccelerometerViewModel />
</views:BasePage.BindingContext>
<StackLayout>
<Label Text="Recuperar los datos de aceleración del dispositivo en el espacio 3D. Además, esta página detectará si sacude su dispositivo.." FontAttributes="Bold" Margin="12" />
<ScrollView>
<Grid Padding="12,0,12,12">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.ColumnSpan="2" Text="{Binding X, StringFormat='X: {0:N}'}" />
<Label Grid.Row="1" Grid.ColumnSpan="2" Text="{Binding Y, StringFormat='Y: {0:N}'}" />
<Label Grid.Row="2" Grid.ColumnSpan="2" Text="{Binding Z, StringFormat='Z: {0:N}'}" />
<Picker Grid.Row="4" Grid.ColumnSpan="2" HorizontalOptions="FillAndExpand"
ItemsSource="{Binding Speeds}"
SelectedIndex="{Binding Speed, Mode=TwoWay}"
/>
<Button Grid.Row="5" Grid.Column="0" Text="Start" Command="{Binding StartCommand}"
/>
<Button Grid.Row="5" Grid.Column="1" Text="Stop" Command="{Binding StopCommand}"
IsEnabled="{Binding IsActive}" />
<Label Grid.Row="6" Grid.ColumnSpan="2" Text="{Binding ShakeTime}"/>
</Grid>
</ScrollView>
</StackLayout>
</views:BasePage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment