Skip to content

Commit 25adc40

Browse files
committed
Merge pull request OfficeDev#213 from TBag/master
O3654-1: Updated slide deck and upgraded projects and documentation to VS 2015. This commit addresses issues #164 and #117.
2 parents 6d52a25 + ea8e896 commit 25adc40

File tree

338 files changed

+102175
-11499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

338 files changed

+102175
-11499
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.24720.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HubApp2", "HubApp2\HubApp2.csproj", "{69BF48C1-AFCE-49AA-BC88-9AC99D6F4589}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|ARM = Debug|ARM
11+
Debug|x64 = Debug|x64
12+
Debug|x86 = Debug|x86
13+
Release|ARM = Release|ARM
14+
Release|x64 = Release|x64
15+
Release|x86 = Release|x86
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{69BF48C1-AFCE-49AA-BC88-9AC99D6F4589}.Debug|ARM.ActiveCfg = Debug|ARM
19+
{69BF48C1-AFCE-49AA-BC88-9AC99D6F4589}.Debug|ARM.Build.0 = Debug|ARM
20+
{69BF48C1-AFCE-49AA-BC88-9AC99D6F4589}.Debug|ARM.Deploy.0 = Debug|ARM
21+
{69BF48C1-AFCE-49AA-BC88-9AC99D6F4589}.Debug|x64.ActiveCfg = Debug|x64
22+
{69BF48C1-AFCE-49AA-BC88-9AC99D6F4589}.Debug|x64.Build.0 = Debug|x64
23+
{69BF48C1-AFCE-49AA-BC88-9AC99D6F4589}.Debug|x64.Deploy.0 = Debug|x64
24+
{69BF48C1-AFCE-49AA-BC88-9AC99D6F4589}.Debug|x86.ActiveCfg = Debug|x86
25+
{69BF48C1-AFCE-49AA-BC88-9AC99D6F4589}.Debug|x86.Build.0 = Debug|x86
26+
{69BF48C1-AFCE-49AA-BC88-9AC99D6F4589}.Debug|x86.Deploy.0 = Debug|x86
27+
{69BF48C1-AFCE-49AA-BC88-9AC99D6F4589}.Release|ARM.ActiveCfg = Release|ARM
28+
{69BF48C1-AFCE-49AA-BC88-9AC99D6F4589}.Release|ARM.Build.0 = Release|ARM
29+
{69BF48C1-AFCE-49AA-BC88-9AC99D6F4589}.Release|ARM.Deploy.0 = Release|ARM
30+
{69BF48C1-AFCE-49AA-BC88-9AC99D6F4589}.Release|x64.ActiveCfg = Release|x64
31+
{69BF48C1-AFCE-49AA-BC88-9AC99D6F4589}.Release|x64.Build.0 = Release|x64
32+
{69BF48C1-AFCE-49AA-BC88-9AC99D6F4589}.Release|x64.Deploy.0 = Release|x64
33+
{69BF48C1-AFCE-49AA-BC88-9AC99D6F4589}.Release|x86.ActiveCfg = Release|x86
34+
{69BF48C1-AFCE-49AA-BC88-9AC99D6F4589}.Release|x86.Build.0 = Release|x86
35+
{69BF48C1-AFCE-49AA-BC88-9AC99D6F4589}.Release|x86.Deploy.0 = Release|x86
36+
EndGlobalSection
37+
GlobalSection(SolutionProperties) = preSolution
38+
HideSolutionNode = FALSE
39+
EndGlobalSection
40+
GlobalSection(TeamFoundationVersionControl) = preSolution
41+
SccNumberOfProjects = 2
42+
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
43+
SccTeamFoundationServer = https://tfs.canviz.com:39776/tfs/canviz
44+
SccLocalPath0 = .
45+
SccProjectUniqueName1 = HubApp2\\HubApp2.csproj
46+
SccProjectName1 = HubApp2
47+
SccLocalPath1 = HubApp2
48+
EndGlobalSection
49+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Application
2+
x:Class="HubApp2.App"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:local="using:HubApp2"
6+
RequestedTheme="Light">
7+
<Application.Resources>
8+
<ResourceDictionary>
9+
<ResourceDictionary.MergedDictionaries>
10+
<ResourceDictionary Source="ms-appx:///styles/CommonDictionary.xaml"/>
11+
</ResourceDictionary.MergedDictionaries>
12+
13+
<!-- Add your client id here. -->
14+
<x:String x:Key="ida:ClientID"></x:String>
15+
<x:String x:Key="ida:AuthorizationUri">https://login.microsoftonline.com</x:String>
16+
</ResourceDictionary>
17+
</Application.Resources>
18+
</Application>
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,37 @@
1-
// Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file.
2-
3-
using Office365StarterProject.ViewModels;
4-
using System;
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Runtime.InteropServices.WindowsRuntime;
56
using Windows.ApplicationModel;
67
using Windows.ApplicationModel.Activation;
8+
using Windows.Foundation;
9+
using Windows.Foundation.Collections;
10+
using Windows.UI.Core;
711
using Windows.UI.Xaml;
812
using Windows.UI.Xaml.Controls;
13+
using Windows.UI.Xaml.Controls.Primitives;
14+
using Windows.UI.Xaml.Data;
15+
using Windows.UI.Xaml.Input;
16+
using Windows.UI.Xaml.Media;
917
using Windows.UI.Xaml.Navigation;
1018

11-
// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227
12-
namespace Office365StarterProject
19+
namespace HubApp2
1320
{
1421
/// <summary>
1522
/// Provides application-specific behavior to supplement the default Application class.
1623
/// </summary>
1724
sealed partial class App : Application
1825
{
19-
/// <summary>
20-
/// Represents the current user of the sample.
21-
/// </summary>
22-
private static UserViewModel _currentUser;
23-
public static UserViewModel CurrentUser
24-
{
25-
get
26-
{
27-
if (_currentUser == null)
28-
{
29-
_currentUser = new UserViewModel();
30-
}
31-
return _currentUser;
32-
}
33-
}
3426
/// <summary>
3527
/// Initializes the singleton application object. This is the first line of authored code
3628
/// executed, and as such is the logical equivalent of main() or WinMain().
3729
/// </summary>
3830
public App()
3931
{
32+
Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync(
33+
Microsoft.ApplicationInsights.WindowsCollectors.Metadata |
34+
Microsoft.ApplicationInsights.WindowsCollectors.Session);
4035
this.InitializeComponent();
4136
this.Suspending += OnSuspending;
4237
}
@@ -46,14 +41,13 @@ public App()
4641
/// will be used such as when the application is launched to open a specific file.
4742
/// </summary>
4843
/// <param name="e">Details about the launch request and process.</param>
49-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0")]
5044
protected override void OnLaunched(LaunchActivatedEventArgs e)
5145
{
5246

5347
#if DEBUG
5448
if (System.Diagnostics.Debugger.IsAttached)
5549
{
56-
this.DebugSettings.EnableFrameRateCounter = false;
50+
this.DebugSettings.EnableFrameRateCounter = true;
5751
}
5852
#endif
5953

@@ -65,10 +59,9 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
6559
{
6660
// Create a Frame to act as the navigation context and navigate to the first page
6761
rootFrame = new Frame();
68-
// Set the default language
69-
rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];
7062

7163
rootFrame.NavigationFailed += OnNavigationFailed;
64+
rootFrame.Navigated += OnNavigated;
7265

7366
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
7467
{
@@ -77,19 +70,50 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
7770

7871
// Place the frame in the current Window
7972
Window.Current.Content = rootFrame;
73+
ResiterBackMethod(rootFrame);
8074
}
8175

8276
if (rootFrame.Content == null)
8377
{
8478
// When the navigation stack isn't restored navigate to the first page,
8579
// configuring the new page by passing required information as a navigation
8680
// parameter
87-
rootFrame.Navigate(typeof(MainPage), e.Arguments);
81+
rootFrame.Navigate(typeof(HubPage), e.Arguments);
8882
}
8983
// Ensure the current window is active
9084
Window.Current.Activate();
9185
}
9286

87+
/// <summary>
88+
/// Invoked when the application is launched normally by the end user. Other entry points
89+
/// will be used such as when the application is launched to open a specific file.
90+
/// </summary>
91+
/// <param name="e">Details about the launch request and process.</param>
92+
private void ResiterBackMethod(Frame rootFrame)
93+
{
94+
SystemNavigationManager.GetForCurrentView().BackRequested += (s, a) =>
95+
{
96+
if (rootFrame.CanGoBack)
97+
{
98+
rootFrame.GoBack();
99+
a.Handled = true;
100+
}
101+
};
102+
103+
SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
104+
rootFrame.CanGoBack ?
105+
AppViewBackButtonVisibility.Visible :
106+
AppViewBackButtonVisibility.Collapsed;
107+
}
108+
109+
private void OnNavigated(object sender, NavigationEventArgs e)
110+
{
111+
SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
112+
((Frame)sender).CanGoBack ?
113+
AppViewBackButtonVisibility.Visible :
114+
AppViewBackButtonVisibility.Collapsed;
115+
}
116+
93117
/// <summary>
94118
/// Invoked when Navigation to a certain page fails
95119
/// </summary>
@@ -115,26 +139,3 @@ private void OnSuspending(object sender, SuspendingEventArgs e)
115139
}
116140
}
117141
}
118-
//*********************************************************
119-
//
120-
// MIT License:
121-
// Permission is hereby granted, free of charge, to any person obtaining
122-
// a copy of this software and associated documentation files (the
123-
// ""Software""), to deal in the Software without restriction, including
124-
// without limitation the rights to use, copy, modify, merge, publish,
125-
// distribute, sublicense, and/or sell copies of the Software, and to
126-
// permit persons to whom the Software is furnished to do so, subject to
127-
// the following conditions:
128-
129-
// The above copyright notice and this permission notice shall be
130-
// included in all copies or substantial portions of the Software.
131-
132-
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
133-
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
134-
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
135-
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
136-
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
137-
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
138-
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
139-
//
140-
//*********************************************************
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ApplicationInsights xmlns = "http://schemas.microsoft.com/ApplicationInsights/2013/Settings">
3+
</ApplicationInsights>
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Collections.ObjectModel;
44
using System.Linq;
55
using System.Threading.Tasks;
6+
using Windows.ApplicationModel;
67
using Windows.Data.Json;
78
using Windows.Storage;
89
using Windows.UI.Xaml.Media;
@@ -122,7 +123,7 @@ private async Task GetSampleDataAsync()
122123

123124
Uri dataUri = new Uri("ms-appx:///DataModel/SampleData.json");
124125

125-
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(dataUri);
126+
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(dataUri);
126127
string jsonText = await FileIO.ReadTextAsync(file);
127128
JsonObject jsonObject = JsonObject.Parse(jsonText);
128129
JsonArray jsonArray = jsonObject["Groups"].GetArray();

0 commit comments

Comments
 (0)