Skip to content
This repository has been archived by the owner on Feb 12, 2021. It is now read-only.

Commit

Permalink
bug fixes + coding format
Browse files Browse the repository at this point in the history
  • Loading branch information
satyambandarapu committed Jan 29, 2015
1 parent 8f0f1be commit 034deb4
Show file tree
Hide file tree
Showing 21 changed files with 923 additions and 487 deletions.
45 changes: 0 additions & 45 deletions License.txt

This file was deleted.

7 changes: 1 addition & 6 deletions Places/AboutPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,21 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="#A4C400">

<Grid x:Name="LayoutRoot">

<Grid.ChildrenTransitions>
<TransitionCollection>
<EntranceThemeTransition/>
</TransitionCollection>
</Grid.ChildrenTransitions>

<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>

</Grid.RowDefinitions>
<!-- TitlePanel -->
<StackPanel Grid.Row="0" Margin="24,17,0,28">
<TextBlock x:Uid="Application" Text="" Style="{ThemeResource TitleTextBlockStyle}" Typography.Capitals="SmallCaps" Foreground="Black"/>
<TextBlock x:Uid="AboutPage" Text="" Margin="0,12,0,0" Style="{ThemeResource HeaderTextBlockStyle}" Foreground="Black"/>
</StackPanel>

<ScrollViewer Grid.Row="1">
<StackPanel x:Name="ContentPanel" Margin="12,0,24,0">
<RichTextBlock Style="{ThemeResource BodyRichTextBlockStyle}">
Expand Down
95 changes: 53 additions & 42 deletions Places/AboutPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,42 +1,61 @@
using Windows.UI.Xaml.Documents;
/*
Copyright (c) 2015 Microsoft
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
using Places.Common;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Graphics.Display;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// The Basic Page item template is documented at http://go.microsoft.com/fwlink/?LinkID=390556

/// <summary>
/// The Basic Page item template is documented at http://go.microsoft.com/fwlink/?LinkID=390556
/// </summary>
namespace Places
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class AboutPage : Page
{
private NavigationHelper navigationHelper;
private ObservableDictionary defaultViewModel = new ObservableDictionary();
#region Private members
/// <summary>
/// Navigation Helper instance
/// </summary>
private NavigationHelper _navigationHelper;

/// <summary>
/// View model instance
/// This can be changed to a strongly typed view model
/// </summary>
private ObservableDictionary _defaultViewModel = new ObservableDictionary();
#endregion

/// <summary>
/// Constructor
/// </summary>
public AboutPage()
{
this.InitializeComponent();

this.navigationHelper = new NavigationHelper(this);
this.navigationHelper.LoadState += this.NavigationHelper_LoadState;
this.navigationHelper.SaveState += this.NavigationHelper_SaveState;

this._navigationHelper = new NavigationHelper(this);
this._navigationHelper.LoadState += this.NavigationHelper_LoadState;
this._navigationHelper.SaveState += this.NavigationHelper_SaveState;
this.Loaded += (sender, args) =>
{
var ver = Windows.ApplicationModel.Package.Current.Id.Version;
Expand All @@ -49,7 +68,7 @@ public AboutPage()
/// </summary>
public NavigationHelper NavigationHelper
{
get { return this.navigationHelper; }
get { return this._navigationHelper; }
}

/// <summary>
Expand All @@ -58,7 +77,7 @@ public NavigationHelper NavigationHelper
/// </summary>
public ObservableDictionary DefaultViewModel
{
get { return this.defaultViewModel; }
get { return this._defaultViewModel; }
}

/// <summary>
Expand All @@ -73,8 +92,7 @@ public ObservableDictionary DefaultViewModel
/// a dictionary of state preserved by this page during an earlier
/// session. The state will be null the first time a page is visited.</param>
private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
{

{
}

/// <summary>
Expand All @@ -90,30 +108,23 @@ private void NavigationHelper_SaveState(object sender, SaveStateEventArgs e)
}

#region NavigationHelper registration

/// <summary>
/// The methods provided in this section are simply used to allow
/// NavigationHelper to respond to the page's navigation methods.
/// <para>
/// Page specific logic should be placed in event handlers for the
/// <see cref="NavigationHelper.LoadState"/>
/// and <see cref="NavigationHelper.SaveState"/>.
/// The navigation parameter is available in the LoadState method
/// in addition to page state preserved during an earlier session.
/// </para>
/// Called when a page becomes the active page in a frame.
/// </summary>
/// <param name="e">Provides data for navigation methods and event
/// handlers that cannot cancel the navigation request.</param>
/// <param name="e">Event arguments</param>
protected override void OnNavigatedTo(NavigationEventArgs e)
{
this.navigationHelper.OnNavigatedTo(e);
this._navigationHelper.OnNavigatedTo(e);
}

/// <summary>
/// Called when a page is no longer the active page in a frame.
/// </summary>
/// <param name="e">Event arguments</param>
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
this.navigationHelper.OnNavigatedFrom(e);
this._navigationHelper.OnNavigatedFrom(e);
}

#endregion
}
}
10 changes: 2 additions & 8 deletions Places/ActivateSensorCore/ActivateSensorCore.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,20 @@
x:Class="Places.ActivateSensorCore"
mc:Ignorable="d"
Background="#A4C400">

<Grid x:Name="LayoutRoot">
<Grid.ChildrenTransitions>
<TransitionCollection>
<EntranceThemeTransition/>
</TransitionCollection>
</Grid.ChildrenTransitions>

<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel x:Name="TopPanel" Grid.Row="0" Margin="24,17,0,28" >
<TextBlock x:Uid="Application" Text="" Style="{ThemeResource TitleTextBlockStyle}" Typography.Capitals="SmallCaps" Foreground="Black"/>
<TextBlock Text="places" Margin="0,12,0,0" Style="{ThemeResource HeaderTextBlockStyle}" Foreground="Black"/>
</StackPanel>

</StackPanel>
<Grid x:Name="MotionDataActivationBox" Grid.Row="1" Visibility="Collapsed" Background="#33000000" Margin="0,0,0,28" VerticalAlignment="Top">
<Grid Margin="10,10,10,10">
<Grid.RowDefinitions>
Expand All @@ -35,13 +32,11 @@
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock x:Uid="/ActivateSensorCore/MotionDataActivationTitle" Grid.Row="0" Foreground="{StaticResource PhoneForegroundBrush}" FontSize="36" />

<TextBlock x:Uid="/ActivateSensorCore/MotionDataActivationExplanation" Grid.Row="1" TextWrapping="Wrap" FontSize="20"/>
<Button x:Uid="/ActivateSensorCore/MotionDataActivationButton" Grid.Row="2" VerticalAlignment="Top" Click="MotionDataActivationButton_Click" HorizontalAlignment="Stretch"/>
<Button x:Uid="/ActivateSensorCore/LaterButton" Grid.Row="3" VerticalAlignment="Top" Click="LaterButton_Click" HorizontalAlignment="Stretch"/>
</Grid>
</Grid>

<Grid x:Name="LocationActivationBox" Grid.Row="1" Visibility="Collapsed" Background="#33000000" Margin="0,0,0,28" VerticalAlignment="Top">
<Grid Margin="10,10,10,10">
<Grid.RowDefinitions>
Expand All @@ -57,6 +52,5 @@
<Button x:Uid="/ActivateSensorCore/LaterButton" Grid.Row="3" Content="Activate" VerticalAlignment="Top" HorizontalAlignment="Stretch" Click="LaterButton_Click"/>
</Grid>
</Grid>

</Grid>
</Page>
</Page>
Loading

0 comments on commit 034deb4

Please sign in to comment.