Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

VictorL - Added W8.1 project. Fixed bug in GetData methods.

  • Loading branch information...
commit 9331e54858e4d9b4b0fade3e2369216cd1f28808 1 parent 7cdd210
Victor Lai authored
Showing with 615 additions and 21 deletions.
  1. +7 −0 UWOpenDataW8/App.xaml
  2. +109 −0 UWOpenDataW8/App.xaml.cs
  3. BIN  UWOpenDataW8/Assets/Logo.scale-100.png
  4. BIN  UWOpenDataW8/Assets/SmallLogo.scale-100.png
  5. BIN  UWOpenDataW8/Assets/SplashScreen.scale-100.png
  6. BIN  UWOpenDataW8/Assets/StoreLogo.scale-100.png
  7. +13 −0 UWOpenDataW8/MainPage.xaml
  8. +30 −0 UWOpenDataW8/MainPage.xaml.cs
  9. +41 −0 UWOpenDataW8/Package.appxmanifest
  10. +29 −0 UWOpenDataW8/Properties/AssemblyInfo.cs
  11. +155 −0 UWOpenDataW8/UWOpenDataW8.csproj
  12. BIN  UWOpenDataW8/UWOpenDataW8_TemporaryKey.pfx
  13. 0  UWOpenDataW8/obj/Debug/App.g.cs
  14. +56 −0 UWOpenDataW8/obj/Debug/App.g.i.cs
  15. +8 −0 UWOpenDataW8/obj/Debug/App.xaml
  16. BIN  UWOpenDataW8/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  17. 0  UWOpenDataW8/obj/Debug/MainPage.g.cs
  18. +35 −0 UWOpenDataW8/obj/Debug/MainPage.g.i.cs
  19. +14 −0 UWOpenDataW8/obj/Debug/MainPage.xaml
  20. 0  UWOpenDataW8/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
  21. 0  UWOpenDataW8/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
  22. 0  UWOpenDataW8/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
  23. +4 −0 UWOpenDataW8/obj/Debug/XamlSaveStateFile.xml
  24. 0  UWOpenDataW8/obj/Debug/XamlTypeInfo.g.cs
  25. +5 −1 UWOpenDataWP8/App.xaml
  26. +59 −0 UWOpenDataWP8/Converters/UpcomingDateTimeToRichStringConverter.cs
  27. +29 −5 UWOpenDataWP8/Pages/HomePage.xaml
  28. +1 −0  UWOpenDataWP8/UWOpenDataWP8.csproj
  29. +14 −8 UWOpenDataWindowsBase/Utilities/DataManager.cs
  30. +6 −7 UWOpenDataWindowsBase/ViewModels/HomePageViewModel.cs
7 UWOpenDataW8/App.xaml
View
@@ -0,0 +1,7 @@
+<Application
+ x:Class="UWOpenDataW8.App"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:local="using:UWOpenDataW8">
+
+</Application>
109 UWOpenDataW8/App.xaml.cs
View
@@ -0,0 +1,109 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.ApplicationModel;
+using Windows.ApplicationModel.Activation;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+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 Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227
+
+namespace UWOpenDataW8
+{
+ /// <summary>
+ /// Provides application-specific behavior to supplement the default Application class.
+ /// </summary>
+ sealed partial class App : Application
+ {
+ /// <summary>
+ /// Initializes the singleton application object. This is the first line of authored code
+ /// executed, and as such is the logical equivalent of main() or WinMain().
+ /// </summary>
+ public App()
+ {
+ this.InitializeComponent();
+ this.Suspending += OnSuspending;
+ }
+
+ /// <summary>
+ /// Invoked when the application is launched normally by the end user. Other entry points
+ /// will be used such as when the application is launched to open a specific file.
+ /// </summary>
+ /// <param name="e">Details about the launch request and process.</param>
+ protected override void OnLaunched(LaunchActivatedEventArgs e)
+ {
+
+#if DEBUG
+ if (System.Diagnostics.Debugger.IsAttached)
+ {
+ this.DebugSettings.EnableFrameRateCounter = true;
+ }
+#endif
+
+ Frame rootFrame = Window.Current.Content as Frame;
+
+ // Do not repeat app initialization when the Window already has content,
+ // just ensure that the window is active
+ if (rootFrame == null)
+ {
+ // Create a Frame to act as the navigation context and navigate to the first page
+ rootFrame = new Frame();
+ // Set the default language
+ rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];
+
+ rootFrame.NavigationFailed += OnNavigationFailed;
+
+ if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
+ {
+ //TODO: Load state from previously suspended application
+ }
+
+ // Place the frame in the current Window
+ Window.Current.Content = rootFrame;
+ }
+
+ if (rootFrame.Content == null)
+ {
+ // When the navigation stack isn't restored navigate to the first page,
+ // configuring the new page by passing required information as a navigation
+ // parameter
+ rootFrame.Navigate(typeof(MainPage), e.Arguments);
+ }
+ // Ensure the current window is active
+ Window.Current.Activate();
+ }
+
+ /// <summary>
+ /// Invoked when Navigation to a certain page fails
+ /// </summary>
+ /// <param name="sender">The Frame which failed navigation</param>
+ /// <param name="e">Details about the navigation failure</param>
+ void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
+ {
+ throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
+ }
+
+ /// <summary>
+ /// Invoked when application execution is being suspended. Application state is saved
+ /// without knowing whether the application will be terminated or resumed with the contents
+ /// of memory still intact.
+ /// </summary>
+ /// <param name="sender">The source of the suspend request.</param>
+ /// <param name="e">Details about the suspend request.</param>
+ private void OnSuspending(object sender, SuspendingEventArgs e)
+ {
+ var deferral = e.SuspendingOperation.GetDeferral();
+ //TODO: Save application state and stop any background activity
+ deferral.Complete();
+ }
+ }
+}
BIN  UWOpenDataW8/Assets/Logo.scale-100.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  UWOpenDataW8/Assets/SmallLogo.scale-100.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  UWOpenDataW8/Assets/SplashScreen.scale-100.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  UWOpenDataW8/Assets/StoreLogo.scale-100.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 UWOpenDataW8/MainPage.xaml
View
@@ -0,0 +1,13 @@
+<Page
+ x:Class="UWOpenDataW8.MainPage"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:local="using:UWOpenDataW8"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ mc:Ignorable="d">
+
+ <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
+
+ </Grid>
+</Page>
30 UWOpenDataW8/MainPage.xaml.cs
View
@@ -0,0 +1,30 @@
+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.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 Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace UWOpenDataW8
+{
+ /// <summary>
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ /// </summary>
+ public sealed partial class MainPage : Page
+ {
+ public MainPage()
+ {
+ this.InitializeComponent();
+ }
+ }
+}
41 UWOpenDataW8/Package.appxmanifest
View
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest">
+
+ <Identity Name="78641c95-29c1-4584-b543-86faf7310d93"
+ Publisher="CN=Victor"
+ Version="1.0.0.0" />
+
+ <Properties>
+ <DisplayName>UWOpenDataW8</DisplayName>
+ <PublisherDisplayName>Victor</PublisherDisplayName>
+ <Logo>Assets\StoreLogo.png</Logo>
+ </Properties>
+
+ <Prerequisites>
+ <OSMinVersion>6.3.0</OSMinVersion>
+ <OSMaxVersionTested>6.3.0</OSMaxVersionTested>
+ </Prerequisites>
+
+ <Resources>
+ <Resource Language="x-generate"/>
+ </Resources>
+
+ <Applications>
+ <Application Id="App"
+ Executable="$targetnametoken$.exe"
+ EntryPoint="UWOpenDataW8.App">
+ <m2:VisualElements
+ DisplayName="UWOpenDataW8"
+ Square150x150Logo="Assets\Logo.png"
+ Square30x30Logo="Assets\SmallLogo.png"
+ Description="UWOpenDataW8"
+ ForegroundText="light"
+ BackgroundColor="#464646">
+ <m2:SplashScreen Image="Assets\SplashScreen.png" />
+ </m2:VisualElements>
+ </Application>
+ </Applications>
+ <Capabilities>
+ <Capability Name="internetClient" />
+ </Capabilities>
+</Package>
29 UWOpenDataW8/Properties/AssemblyInfo.cs
View
@@ -0,0 +1,29 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("UWOpenDataW8")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("UWOpenDataW8")]
+[assembly: AssemblyCopyright("Copyright © 2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: ComVisible(false)]
155 UWOpenDataW8/UWOpenDataW8.csproj
View
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{7f4c08c2-5e59-45ac-a471-dc7469ee3b58}</ProjectGuid>
+ <OutputType>AppContainerExe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>UWOpenDataW8</RootNamespace>
+ <AssemblyName>UWOpenDataW8</AssemblyName>
+ <DefaultLanguage>en-US</DefaultLanguage>
+ <TargetPlatformVersion>8.1</TargetPlatformVersion>
+ <MinimumVisualStudioVersion>12</MinimumVisualStudioVersion>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+
+ <PackageCertificateKeyFile>UWOpenDataW8_TemporaryKey.pfx</PackageCertificateKeyFile>
+
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE;NETFX_CORE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>bin\ARM\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>full</DebugType>
+ <PlatformTarget>ARM</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
+ <OutputPath>bin\ARM\Release\</OutputPath>
+ <DefineConstants>TRACE;NETFX_CORE</DefineConstants>
+ <Optimize>true</Optimize>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>ARM</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>bin\x64\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>full</DebugType>
+ <PlatformTarget>x64</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+ <OutputPath>bin\x64\Release\</OutputPath>
+ <DefineConstants>TRACE;NETFX_CORE</DefineConstants>
+ <Optimize>true</Optimize>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>x64</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>bin\x86\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>full</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+ <OutputPath>bin\x86\Release\</OutputPath>
+ <DefineConstants>TRACE;NETFX_CORE</DefineConstants>
+ <Optimize>true</Optimize>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <ItemGroup>
+ <!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="MainPage.xaml.cs">
+ <DependentUpon>MainPage.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <AppxManifest Include="Package.appxmanifest">
+ <SubType>Designer</SubType>
+ </AppxManifest>
+
+ <None Include="UWOpenDataW8_TemporaryKey.pfx" />
+
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Assets\Logo.scale-100.png" />
+ <Content Include="Assets\SmallLogo.scale-100.png" />
+ <Content Include="Assets\SplashScreen.scale-100.png" />
+ <Content Include="Assets\StoreLogo.scale-100.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </ApplicationDefinition>
+ <Page Include="MainPage.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ </ItemGroup>
+
+ <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '12.0' ">
+ <VisualStudioVersion>12.0</VisualStudioVersion>
+ </PropertyGroup>
+
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
BIN  UWOpenDataW8/UWOpenDataW8_TemporaryKey.pfx
View
Binary file not shown
0  UWOpenDataW8/obj/Debug/App.g.cs
View
No changes.
56 UWOpenDataW8/obj/Debug/App.g.i.cs
View
@@ -0,0 +1,56 @@
+
+
+#pragma checksum "F:\Root\Air\Git\uwdata\UWOpenData\UWOpenDataW8\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "24F128654749183E671B72F097B944CA"
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+
+namespace UWOpenDataW8
+{
+#if !DISABLE_XAML_GENERATED_MAIN
+ public static class Program
+ {
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ static void Main(string[] args)
+ {
+ global::Windows.UI.Xaml.Application.Start((p) => new App());
+ }
+ }
+#endif
+
+ partial class App : global::Windows.UI.Xaml.Application
+ {
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
+ private bool _contentLoaded;
+
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ public void InitializeComponent()
+ {
+ if (_contentLoaded)
+ return;
+
+ _contentLoaded = true;
+#if DEBUG && !DISABLE_XAML_GENERATED_BINDING_DEBUG_OUTPUT
+ DebugSettings.BindingFailed += (sender, args) =>
+ {
+ global::System.Diagnostics.Debug.WriteLine(args.Message);
+ };
+#endif
+#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
+ UnhandledException += (sender, e) =>
+ {
+ if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
+ };
+#endif
+ }
+ }
+}
+
8 UWOpenDataW8/obj/Debug/App.xaml
View
@@ -0,0 +1,8 @@
+<Application
+ x:Class="UWOpenDataW8.App"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:local="using:UWOpenDataW8">
+
+</Application>
+
BIN  UWOpenDataW8/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
View
Binary file not shown
0  UWOpenDataW8/obj/Debug/MainPage.g.cs
View
No changes.
35 UWOpenDataW8/obj/Debug/MainPage.g.i.cs
View
@@ -0,0 +1,35 @@
+
+
+#pragma checksum "F:\Root\Air\Git\uwdata\UWOpenData\UWOpenDataW8\MainPage.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "1C75658E9FE63C61931D21F2E507E29D"
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace UWOpenDataW8
+{
+ partial class MainPage : global::Windows.UI.Xaml.Controls.Page
+ {
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
+ private bool _contentLoaded;
+
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ public void InitializeComponent()
+ {
+ if (_contentLoaded)
+ return;
+
+ _contentLoaded = true;
+ global::Windows.UI.Xaml.Application.LoadComponent(this, new global::System.Uri("ms-appx:///MainPage.xaml"), global::Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
+
+ }
+ }
+}
+
+
+
14 UWOpenDataW8/obj/Debug/MainPage.xaml
View
@@ -0,0 +1,14 @@
+<Page
+ x:Class="UWOpenDataW8.MainPage"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:local="using:UWOpenDataW8"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ mc:Ignorable="d">
+
+ <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
+
+ </Grid>
+</Page>
+
0  UWOpenDataW8/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
View
No changes.
0  UWOpenDataW8/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
View
No changes.
0  UWOpenDataW8/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
View
No changes.
4 UWOpenDataW8/obj/Debug/XamlSaveStateFile.xml
View
@@ -0,0 +1,4 @@
+<XamlCompilerSaveState>
+ <ReferenceAssemblyList>
+ </ReferenceAssemblyList>
+</XamlCompilerSaveState>
0  UWOpenDataW8/obj/Debug/XamlTypeInfo.g.cs
View
No changes.
6 UWOpenDataWP8/App.xaml
View
@@ -6,11 +6,15 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
d1p1:Ignorable="d"
xmlns:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:viewModels="clr-namespace:UWOpenDataWP8.ViewModels">
+ xmlns:viewModels="clr-namespace:UWOpenDataWP8.ViewModels"
+ xmlns:converters="clr-namespace:UWOpenDataWP8.Converters">
<!--Application Resources-->
<Application.Resources>
<local:LocalizedStrings xmlns:local="clr-namespace:UWOpenDataWP8" x:Key="LocalizedStrings" />
<viewModels:ViewModelLocator x:Key="Locator" d:IsDataSource="True" />
+
+ <converters:UpcomingDateTimeToRichStringConverter x:Key="UpcomingDateTimeToRichStringConverter"/>
+
</Application.Resources>
<Application.ApplicationLifetimeObjects>
<!--Required object that handles lifetime events for the application-->
59 UWOpenDataWP8/Converters/UpcomingDateTimeToRichStringConverter.cs
View
@@ -0,0 +1,59 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace UWOpenDataWP8.Converters
+{
+ public class UpcomingDateTimeToRichStringConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value is String)
+ {
+ DateTime inputDateTime;
+
+ if (DateTime.TryParse(value as String, culture, DateTimeStyles.AdjustToUniversal, out inputDateTime))
+ {
+ return GetRichString(inputDateTime);
+ }
+ else
+ {
+ return value;
+ }
+ }
+ else if (value is DateTime)
+ {
+ return GetRichString((DateTime)value);
+ }
+ return DependencyProperty.UnsetValue;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException("ConvertBack: " + this.GetType().Name);
+ }
+
+ public String GetRichString(DateTime upcomingDate)
+ {
+ if (upcomingDate.Date.ToUniversalTime() >= DateTime.UtcNow.Date.AddDays(14))
+ {
+ return upcomingDate.ToLongDateString();
+ }
+ if (upcomingDate.Date.ToUniversalTime() >= DateTime.UtcNow.Date.AddDays(7))
+ {
+ return String.Format("{0} {1}", "next", upcomingDate.DayOfWeek);
+ }
+ if (upcomingDate.Date.ToUniversalTime() >= DateTime.UtcNow.Date.AddDays(1))
+ {
+ return String.Format("{0} {1}", "this", upcomingDate.DayOfWeek);
+ }
+ return String.Format("{0} {1}", "in", upcomingDate.ToShortTimeString());
+ }
+ }
+}
34 UWOpenDataWP8/Pages/HomePage.xaml
View
@@ -27,11 +27,35 @@
<Grid x:Name="ContentPanel" Grid.Row="1">
<phone:Pivot>
- <phone:PivotItem Header="Events">
-
- </phone:PivotItem>
- <phone:PivotItem Header="Weather">
-
+ <phone:PivotItem Header="Home">
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="*"/>
+ </Grid.RowDefinitions>
+ <Grid Grid.Row="0">
+ <TextBlock>
+ <Run Text="Current Temp."/>
+ <Run Text="{Binding WeatherData.temperature_current_c}"/>
+ </TextBlock>
+ </Grid>
+ <Grid Grid.Row="1">
+ <ListBox ItemsSource="{Binding EventsHolidaysList}">
+ <ListBox.ItemTemplate>
+ <DataTemplate>
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="Auto"/>
+ </Grid.RowDefinitions>
+ <TextBlock Grid.Row="0" Text="{Binding name}"></TextBlock>
+ <TextBlock Grid.Row="1" Text="{Binding date, Converter={StaticResource UpcomingDateTimeToRichStringConverter}}"></TextBlock>
+ </Grid>
+ </DataTemplate>
+ </ListBox.ItemTemplate>
+ </ListBox>
+ </Grid>
+ </Grid>
</phone:PivotItem>
</phone:Pivot>
</Grid>
1  UWOpenDataWP8/UWOpenDataWP8.csproj
View
@@ -93,6 +93,7 @@
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
+ <Compile Include="Converters\UpcomingDateTimeToRichStringConverter.cs" />
<Compile Include="LocalizedStrings.cs" />
<Compile Include="Pages\HomePage.xaml.cs">
<DependentUpon>HomePage.xaml</DependentUpon>
22 UWOpenDataWindowsBase/Utilities/DataManager.cs
View
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
@@ -37,6 +38,9 @@ public DataManager(IStorageManager storageManager)
cancellationToken.ThrowIfCancellationRequested();
ThrowIfStorageManagerNotInstantiated();
+ Debug.WriteLine("StorageKey: " + storageKey);
+ Debug.WriteLine(ShouldDownloadData(storageKey) ? "Downloading new data" : "Getting cached data");
+
if (ShouldDownloadData(storageKey))
{
var data = await downloadFunc(cancellationToken);
@@ -49,8 +53,10 @@ public DataManager(IStorageManager storageManager)
}
else
{
+ Debug.WriteLine("An error has occurred with the downloaded data");
RemoveDataTimeStamp(storageKey);
_storageManager.DeleteKey(storageKey);
+ return null;
}
}
@@ -64,11 +70,13 @@ public Boolean ShouldDownloadData(DataKey key)
{
return true;
}
-
- // data has expired
- if (DateTime.UtcNow >= _dataKeyToTimeStampDictionary[key])
+ else
{
- return true;
+ // data has expired
+ if (DateTime.UtcNow >= _dataKeyToTimeStampDictionary[key])
+ {
+ return true;
+ }
}
return false;
@@ -98,13 +106,11 @@ private void AddOrUpdateDataTimeStamp(DataKey key)
{
if (_dataKeyToTimeStampDictionary.ContainsKey(key))
{
- _dataKeyToTimeStampDictionary[Constants.EventsHolidaysDataKey] =
- DateTime.UtcNow.AddMinutes(Constants.DataCacheTimeInMinutes);
+ _dataKeyToTimeStampDictionary[key] = DateTime.UtcNow.AddMinutes(Constants.DataCacheTimeInMinutes);
}
else
{
- _dataKeyToTimeStampDictionary.Add(Constants.EventsHolidaysDataKey,
- DateTime.UtcNow.AddMinutes(Constants.DataCacheTimeInMinutes));
+ _dataKeyToTimeStampDictionary.Add(key,DateTime.UtcNow.AddMinutes(Constants.DataCacheTimeInMinutes));
}
}
13 UWOpenDataWindowsBase/ViewModels/HomePageViewModel.cs
View
@@ -108,15 +108,17 @@ public WeatherData WeatherData
var eventsListData = await GetData(EventsHolidaysListPropertyName, UwOpenDataApi.GetEventsHolidayData,
cancellationToken);
- EventsHolidaysList = new ObservableCollection<HolidaysData>(eventsListData.data);
-
- foreach (var holidayData in EventsHolidaysList)
+ foreach (var holidayData in eventsListData.data)
{
DateTime holidayDateTime;
if (DateTime.TryParse(holidayData.date, out holidayDateTime))
{
- Debug.WriteLine(holidayDateTime);
+ if (holidayDateTime.ToUniversalTime().Date >= DateTime.UtcNow.Date)
+ {
+ EventsHolidaysList.Add(holidayData);
+ Debug.WriteLine(holidayDateTime);
+ }
}
}
}
@@ -130,9 +132,6 @@ public WeatherData WeatherData
{
WeatherData = weatherData.data;
}
-
}
-
-
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.