From 07357b9327476d1dea66b3fbe59f5d18317103c9 Mon Sep 17 00:00:00 2001 From: Tobias Klika Date: Tue, 11 Feb 2014 21:55:22 +0100 Subject: [PATCH] add wp7 project --- .../PocketSharp.WP8/App.xaml.cs | 13 +- PocketSharp.WP7/App.xaml | 19 +++ PocketSharp.WP7/App.xaml.cs | 151 +++++++++++++++++ PocketSharp.WP7/ApplicationIcon.png | Bin 0 -> 1881 bytes PocketSharp.WP7/Background.png | Bin 0 -> 3521 bytes PocketSharp.WP7/MainPage.xaml | 45 ++++++ PocketSharp.WP7/MainPage.xaml.cs | 22 +++ PocketSharp.WP7/PocketSharp.WP7.csproj | 152 ++++++++++++++++++ PocketSharp.WP7/Properties/AppManifest.xml | 6 + PocketSharp.WP7/Properties/AssemblyInfo.cs | 37 +++++ PocketSharp.WP7/Properties/WMAppManifest.xml | 35 ++++ PocketSharp.WP7/SplashScreenImage.jpg | Bin 0 -> 9417 bytes PocketSharp.WP7/ViewModels/ItemViewModel.cs | 102 ++++++++++++ PocketSharp.WP7/ViewModels/MainViewModel.cs | 106 ++++++++++++ PocketSharp.WP7/packages.config | 7 + PocketSharp.sln | 13 ++ 16 files changed, 701 insertions(+), 7 deletions(-) create mode 100644 PocketSharp.WP7/App.xaml create mode 100644 PocketSharp.WP7/App.xaml.cs create mode 100644 PocketSharp.WP7/ApplicationIcon.png create mode 100644 PocketSharp.WP7/Background.png create mode 100644 PocketSharp.WP7/MainPage.xaml create mode 100644 PocketSharp.WP7/MainPage.xaml.cs create mode 100644 PocketSharp.WP7/PocketSharp.WP7.csproj create mode 100644 PocketSharp.WP7/Properties/AppManifest.xml create mode 100644 PocketSharp.WP7/Properties/AssemblyInfo.cs create mode 100644 PocketSharp.WP7/Properties/WMAppManifest.xml create mode 100644 PocketSharp.WP7/SplashScreenImage.jpg create mode 100644 PocketSharp.WP7/ViewModels/ItemViewModel.cs create mode 100644 PocketSharp.WP7/ViewModels/MainViewModel.cs create mode 100644 PocketSharp.WP7/packages.config diff --git a/PocketSharp.Examples/PocketSharp.WP8/App.xaml.cs b/PocketSharp.Examples/PocketSharp.WP8/App.xaml.cs index fb2a7f5..57784d2 100644 --- a/PocketSharp.Examples/PocketSharp.WP8/App.xaml.cs +++ b/PocketSharp.Examples/PocketSharp.WP8/App.xaml.cs @@ -1,13 +1,12 @@ -using System; -using System.Diagnostics; -using System.Resources; -using System.Windows; -using System.Windows.Markup; -using System.Windows.Navigation; -using Microsoft.Phone.Controls; +using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; using PocketSharp.WP8.Resources; using PocketSharp.WP8.ViewModels; +using System; +using System.Diagnostics; +using System.Windows; +using System.Windows.Markup; +using System.Windows.Navigation; namespace PocketSharp.WP8 { diff --git a/PocketSharp.WP7/App.xaml b/PocketSharp.WP7/App.xaml new file mode 100644 index 0000000..96a9a98 --- /dev/null +++ b/PocketSharp.WP7/App.xaml @@ -0,0 +1,19 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/PocketSharp.WP7/App.xaml.cs b/PocketSharp.WP7/App.xaml.cs new file mode 100644 index 0000000..5467dc2 --- /dev/null +++ b/PocketSharp.WP7/App.xaml.cs @@ -0,0 +1,151 @@ +using Microsoft.Phone.Controls; +using Microsoft.Phone.Shell; +using PocketSharp.WP7.ViewModels; +using System.Windows; +using System.Windows.Navigation; + +namespace PocketSharp.WP7 +{ + public partial class App : Application + { + private static MainViewModel viewModel = null; + + /// + /// A static ViewModel used by the views to bind against. + /// + /// The MainViewModel object. + public static MainViewModel ViewModel + { + get + { + // Delay creation of the view model until necessary + if (viewModel == null) + viewModel = new MainViewModel(); + + return viewModel; + } + } + + /// + /// Provides easy access to the root frame of the Phone Application. + /// + /// The root frame of the Phone Application. + public PhoneApplicationFrame RootFrame { get; private set; } + + /// + /// Constructor for the Application object. + /// + public App() + { + // Global handler for uncaught exceptions. + UnhandledException += Application_UnhandledException; + + // Standard Silverlight initialization + InitializeComponent(); + + // Phone-specific initialization + InitializePhoneApplication(); + + // Show graphics profiling information while debugging. + if (System.Diagnostics.Debugger.IsAttached) + { + // Display the current frame rate counters. + Application.Current.Host.Settings.EnableFrameRateCounter = true; + + // Show the areas of the app that are being redrawn in each frame. + //Application.Current.Host.Settings.EnableRedrawRegions = true; + + // Enable non-production analysis visualization mode, + // which shows areas of a page that are handed off to GPU with a colored overlay. + //Application.Current.Host.Settings.EnableCacheVisualization = true; + + // Disable the application idle detection by setting the UserIdleDetectionMode property of the + // application's PhoneApplicationService object to Disabled. + // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run + // and consume battery power when the user is not using the phone. + PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; + } + + } + + // Code to execute when the application is launching (eg, from Start) + // This code will not execute when the application is reactivated + private void Application_Launching(object sender, LaunchingEventArgs e) + { + } + + // Code to execute when the application is activated (brought to foreground) + // This code will not execute when the application is first launched + private void Application_Activated(object sender, ActivatedEventArgs e) + { + } + + // Code to execute when the application is deactivated (sent to background) + // This code will not execute when the application is closing + private void Application_Deactivated(object sender, DeactivatedEventArgs e) + { + } + + // Code to execute when the application is closing (eg, user hit Back) + // This code will not execute when the application is deactivated + private void Application_Closing(object sender, ClosingEventArgs e) + { + } + + // Code to execute if a navigation fails + private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e) + { + if (System.Diagnostics.Debugger.IsAttached) + { + // A navigation has failed; break into the debugger + System.Diagnostics.Debugger.Break(); + } + } + + // Code to execute on Unhandled Exceptions + private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) + { + if (System.Diagnostics.Debugger.IsAttached) + { + // An unhandled exception has occurred; break into the debugger + System.Diagnostics.Debugger.Break(); + } + } + + #region Phone application initialization + + // Avoid double-initialization + private bool phoneApplicationInitialized = false; + + // Do not add any additional code to this method + private void InitializePhoneApplication() + { + if (phoneApplicationInitialized) + return; + + // Create the frame but don't set it as RootVisual yet; this allows the splash + // screen to remain active until the application is ready to render. + RootFrame = new PhoneApplicationFrame(); + RootFrame.Navigated += CompleteInitializePhoneApplication; + + // Handle navigation failures + RootFrame.NavigationFailed += RootFrame_NavigationFailed; + + // Ensure we don't initialize again + phoneApplicationInitialized = true; + } + + // Do not add any additional code to this method + private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e) + { + // Set the root visual to allow the application to render + if (RootVisual != RootFrame) + RootVisual = RootFrame; + + // Remove this handler since it is no longer needed + RootFrame.Navigated -= CompleteInitializePhoneApplication; + } + + #endregion + } +} \ No newline at end of file diff --git a/PocketSharp.WP7/ApplicationIcon.png b/PocketSharp.WP7/ApplicationIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..5859393ca1056103ba35d225773352a9fa3ab754 GIT binary patch literal 1881 zcmV-f2d4OmP)GXLPE9uD;d|3K9jFs0^O3no;*#kUHY6H}PH_^L3*aj} zl+rSw?L`W0p^tkju#a}u3PxyqFY3}?ZpgV`?z#P)?|kQbU67g4(Jt>MC@$|ToYbAv zoz$Jwoz$JwUyrEBh@^xBYY9T32$%4g4Eozd9YH8m>Im7iz@UwrH+y+`StMa0!Jlv1 zOs9{eP8~IOLbaYWZ(elNbZg1v$&=#~5`=udMY3Y~^2n$tPDrTrV}g_vPDsd`qdqj` z?(SZ2=x{`MxJ4Ea7yy62*t!)g2L{u*+?5%tV8G+?EYFApOLBK?H(-W0sdbrL7RKcs zEi7D+mK#@=wJ2&3^B#Z6SE|tW^ z&fa_A0KDdD7g}CkuGQ%*uYy_6tlm5}8JiaBN~M03ks%g~tMA@5>&#%lv|6osRa0w$GfX-lmv6;tg7E35t(xdFTQCUeAbpwWpTg5+|K7IY# zwbIg(hK5FUUmu3O*mrLl?KRUayoa}&LPcB<-$|3+(JUi7*{UTR~?sv$M1P1N>*rj)mLHrKNHON-lLA!%9m^1R@cPXUv=l zmwktfMx&WuVn$tE?SL(YK0XhFAR`119z6nm6Brlagxr7dz}8t~Yn@7=%#V+Eb8|(} zt{zpd`CNjX*sbr;=t5DIS`Dt#+slj1W=)+krM;u$iMZ8K>adS$jr!2xBjD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w$j9Fp Tu#Z&K00000NkvXXu0mjfnP|DN literal 0 HcmV?d00001 diff --git a/PocketSharp.WP7/Background.png b/PocketSharp.WP7/Background.png new file mode 100644 index 0000000000000000000000000000000000000000..e46f21d9407f1ae4d6fedcf793778f32bae3f06d GIT binary patch literal 3521 zcmcInXHZjHyQUKa0*D|z9EwQqn$QW&LN5a0(9}p#z|av07z0wI3P?4PNKpZi&_Sw4 zLlF)jASHB>Dnt^hfxGX|`|JMszCE+|nprb@t(o_I+M8@^ZNYs`CMWRa_{X2b%~(Y4zZGoHG0TeeRQ-3xz&pF>q?5Cn9|4FxbFSa1h; zjwu3)x4dE>KCH#zaAiRhDpgE3ysD%`9LDRo_6rwxdbIRUYCu4MRTEfTM@v$&tGk!E%3QMmgErV+_P0kPK2#3KPgk)p2??OnY?$-L(8itp8(PcD%WG=V4eWeBKBB#C zYZDE~%gLz^-$tmtn#cNPvSc8RfwlV(hoa{9zk~VXLOJ)XhsB7pKkMPS13jV&n4D9_wYu%NS)+IVL>be8L z3lCzHhQWlZ1CPyKy?QlPZpCbaLm$6cOzHuOJ$0hK@cyq$ScTc?U#gQegC6dd{;vrR%RV6J^?a&mHfe4OM1g~1BwAX}4N5{V?qJ|QqI zp&z;YIW1|_&(AO7*Q`33kv{G#TgY8<64uGNou)Awsz128yVz^RF5sp7a~Q|Nnaq60 zqqbE-FEW1Y%X*a36;G18RtF2oVS$H%vu@y_}E#CqsT z*9Ls0Gv-J`(#VciRP|v&8 zwU<;qJ94No{r$#1K5`l#?2-?0K8j)ju(hCWp^iujym;A|0tZ)}N84q)ww`j*_h*92 z%F33w9!N^$YqNvFU^NxY{Cmk78!R~_B;;g^IQ&pzAllK%DWQieOxijkAVB#K!jMbg zk4d*!b93`E3H|BeVH@Fx)cyVajVvNDWshOoBN=3^$94i_QtlO|5})p2)z;IU&NB~pcX2+xSF`q)vNkq154L9_4t}{) zc*bx2L9<;*Nlm5jU(WwXv9%0~i16%)Ia(VbR9!sQI4OVq`gKKxTX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}dMh&JL(E9mF&$s}VZv4yZ z7q}Ep0KV_cwh&ue5l6I7$^4g@Xeg$Zt~C{hPw^1+q4#8syBCvMpDy;nt;Xz*$*!t@ z_4*|-zdS$FPfs2YPj|ps-Mc7{`(+ zaPeYMY?js@h8NSa`7xldu<+l>p!ts2#U55-G!qz`@+AX8D2rD0l#TWLS+vA|cEtpXb}@)WHY-Vw4#Wd98N+omYttII7v_He)|{>c literal 0 HcmV?d00001 diff --git a/PocketSharp.WP7/MainPage.xaml b/PocketSharp.WP7/MainPage.xaml new file mode 100644 index 0000000..2db2405 --- /dev/null +++ b/PocketSharp.WP7/MainPage.xaml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PocketSharp.WP7/MainPage.xaml.cs b/PocketSharp.WP7/MainPage.xaml.cs new file mode 100644 index 0000000..cc6fb60 --- /dev/null +++ b/PocketSharp.WP7/MainPage.xaml.cs @@ -0,0 +1,22 @@ +using Microsoft.Phone.Controls; +using System.Windows; + +namespace PocketSharp.WP7 +{ + public partial class MainPage : PhoneApplicationPage + { + // Constructor + public MainPage() + { + InitializeComponent(); + + // Set the data context of the LongListSelector control to the sample data + DataContext = App.ViewModel; + } + + private async void Button_Click(object sender, RoutedEventArgs e) + { + await App.ViewModel.LoadData(); + } + } +} \ No newline at end of file diff --git a/PocketSharp.WP7/PocketSharp.WP7.csproj b/PocketSharp.WP7/PocketSharp.WP7.csproj new file mode 100644 index 0000000..29e454b --- /dev/null +++ b/PocketSharp.WP7/PocketSharp.WP7.csproj @@ -0,0 +1,152 @@ + + + + Debug + AnyCPU + 10.0.20506 + 2.0 + {6F542037-C48B-4EC5-A326-DDBEBF5FDFA2} + {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + PocketSharp.WP7 + PocketSharp.WP7 + v4.0 + $(TargetFrameworkVersion) + WindowsPhone71 + Silverlight + true + + + true + true + PocketSharp.WP7.xap + Properties\AppManifest.xml + PocketSharp.WP7.App + true + true + ..\ + true + + + true + full + false + Bin\Debug + DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE + true + true + prompt + 4 + + + pdbonly + true + Bin\Release + TRACE;SILVERLIGHT;WINDOWS_PHONE + true + true + prompt + 4 + + + + + + ..\packages\Microsoft.Bcl.Async.1.0.165\lib\sl4-windowsphone71\Microsoft.Threading.Tasks.dll + + + ..\packages\Microsoft.Bcl.Async.1.0.165\lib\sl4-windowsphone71\Microsoft.Threading.Tasks.Extensions.dll + + + ..\packages\Microsoft.Bcl.Async.1.0.165\lib\sl4-windowsphone71\Microsoft.Threading.Tasks.Extensions.Phone.dll + + + ..\packages\Microsoft.Bcl.1.1.3\lib\sl4-windowsphone71\System.IO.dll + + + ..\packages\Microsoft.Net.Http.2.2.18\lib\sl4-windowsphone71\System.Net.Http.dll + + + ..\packages\Microsoft.Net.Http.2.2.18\lib\sl4-windowsphone71\System.Net.Http.Extensions.dll + + + ..\packages\Microsoft.Net.Http.2.2.18\lib\sl4-windowsphone71\System.Net.Http.Primitives.dll + + + ..\packages\Microsoft.Bcl.1.1.3\lib\sl4-windowsphone71\System.Runtime.dll + + + ..\packages\Microsoft.Bcl.1.1.3\lib\sl4-windowsphone71\System.Threading.Tasks.dll + + + + + + + + + + + App.xaml + + + MainPage.xaml + + + + + + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + + + + {817200C3-A327-4E35-9B5F-63A51C088577} + PocketSharp + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + \ No newline at end of file diff --git a/PocketSharp.WP7/Properties/AppManifest.xml b/PocketSharp.WP7/Properties/AppManifest.xml new file mode 100644 index 0000000..6712a11 --- /dev/null +++ b/PocketSharp.WP7/Properties/AppManifest.xml @@ -0,0 +1,6 @@ + + + + diff --git a/PocketSharp.WP7/Properties/AssemblyInfo.cs b/PocketSharp.WP7/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..b102d2b --- /dev/null +++ b/PocketSharp.WP7/Properties/AssemblyInfo.cs @@ -0,0 +1,37 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Resources; + +// 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("PocketSharp.WP7")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PocketSharp.WP7")] +[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("775e1575-245f-45be-85f8-e6289b22b330")] + +// 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 Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: NeutralResourcesLanguageAttribute("en-US")] diff --git a/PocketSharp.WP7/Properties/WMAppManifest.xml b/PocketSharp.WP7/Properties/WMAppManifest.xml new file mode 100644 index 0000000..79314b5 --- /dev/null +++ b/PocketSharp.WP7/Properties/WMAppManifest.xml @@ -0,0 +1,35 @@ + + + + + ApplicationIcon.png + + + + + + + + + + + + + + + + + + + + + + + Background.png + 0 + PocketSharp.WP7 + + + + + diff --git a/PocketSharp.WP7/SplashScreenImage.jpg b/PocketSharp.WP7/SplashScreenImage.jpg new file mode 100644 index 0000000000000000000000000000000000000000..353b1927b9d397aac7f23098e427739615db19fd GIT binary patch literal 9417 zcmeH}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ZuU&D|E3Ic%kyc!5EOS75oN zF0Q+vdyW34hHJ(PVTUB?60}@vAjdt8j6^l4bmz;UCbn&oxpia(WaXEIduORWk1=QL z-auqMOEWN8+e`&L{p3rTa6< z#h389yo`yUXV=D+G%b&xkZ=ch$7^uVR=DpdeyMqQ8P5ztfi>OJN-crq{o9>C?T~#} zW8z<{ab0mLbalYScv9}i)FaCT$1}@4KQ&z6s;3wDgAdhp7kq9>hkG|PH>{2WKMN#N z!AwVnO4P(;ydA&B!i;xjK)tZScnZU|NWljZHvT=LF*iVg;yH)P-Ucz@J?AR_iG?;~ zZa=iNO{V*i7aE~AExt5 zUrCr@ZS4sZ9ph09stY8k0dcHKsxlG9xe1Tzkwe)je47loni5ezjp1$Pr|T1Rw34}9 zZ95t2Di|ycn>Fs++D9H&zI8gnSWRkLrS(}Z{(ky0eA?pvhQ8KJ#$?KFmPf5pK?)W=_QKorGU6lW0wA_hbZh!_wtAYwqo UfQSJR10n`Q4E%c;KnlnH2jCM6ivR!s literal 0 HcmV?d00001 diff --git a/PocketSharp.WP7/ViewModels/ItemViewModel.cs b/PocketSharp.WP7/ViewModels/ItemViewModel.cs new file mode 100644 index 0000000..fef68cb --- /dev/null +++ b/PocketSharp.WP7/ViewModels/ItemViewModel.cs @@ -0,0 +1,102 @@ +using System; +using System.ComponentModel; + +namespace PocketSharp.WP7.ViewModels +{ + public class ItemViewModel : INotifyPropertyChanged + { + private string _id; + /// + /// Sample ViewModel property; this property is used to identify the object. + /// + /// + public string ID + { + get + { + return _id; + } + set + { + if (value != _id) + { + _id = value; + NotifyPropertyChanged("ID"); + } + } + } + + private string _lineOne; + /// + /// Sample ViewModel property; this property is used in the view to display its value using a Binding. + /// + /// + public string LineOne + { + get + { + return _lineOne; + } + set + { + if (value != _lineOne) + { + _lineOne = value; + NotifyPropertyChanged("LineOne"); + } + } + } + + private string _lineTwo; + /// + /// Sample ViewModel property; this property is used in the view to display its value using a Binding. + /// + /// + public string LineTwo + { + get + { + return _lineTwo; + } + set + { + if (value != _lineTwo) + { + _lineTwo = value; + NotifyPropertyChanged("LineTwo"); + } + } + } + + private string _lineThree; + /// + /// Sample ViewModel property; this property is used in the view to display its value using a Binding. + /// + /// + public string LineThree + { + get + { + return _lineThree; + } + set + { + if (value != _lineThree) + { + _lineThree = value; + NotifyPropertyChanged("LineThree"); + } + } + } + + public event PropertyChangedEventHandler PropertyChanged; + private void NotifyPropertyChanged(String propertyName) + { + PropertyChangedEventHandler handler = PropertyChanged; + if (null != handler) + { + handler(this, new PropertyChangedEventArgs(propertyName)); + } + } + } +} \ No newline at end of file diff --git a/PocketSharp.WP7/ViewModels/MainViewModel.cs b/PocketSharp.WP7/ViewModels/MainViewModel.cs new file mode 100644 index 0000000..c0fceb6 --- /dev/null +++ b/PocketSharp.WP7/ViewModels/MainViewModel.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Diagnostics; +using System.Threading.Tasks; + +namespace PocketSharp.WP7.ViewModels +{ + public class MainViewModel : INotifyPropertyChanged + { + public MainViewModel() + { + this.Items = new ObservableCollection(); + } + + /// + /// A collection for ItemViewModel objects. + /// + public ObservableCollection Items { get; private set; } + + private string _sampleProperty = "Sample Runtime Property Value"; + /// + /// Sample ViewModel property; this property is used in the view to display its value using a Binding + /// + /// + public string SampleProperty + { + get + { + return _sampleProperty; + } + set + { + if (value != _sampleProperty) + { + _sampleProperty = value; + NotifyPropertyChanged("SampleProperty"); + } + } + } + + /// + /// Sample property that returns a localized string + /// + public string LocalizedSampleProperty + { + get + { + return "test"; + } + } + + public bool IsDataLoaded + { + get; + private set; + } + + /// + /// Creates and adds a few ItemViewModel objects into the Items collection. + /// + public async Task LoadData() + { + // !! please don't misuse this account !! + PocketClient client = new PocketClient( + consumerKey: "15396-f6f92101d72c8e270a6c9bb3", + callbackUri: "http://frontendplay.com", + accessCode: "80acf6c5-c198-03c0-b94c-e74402" + ); + + List items = null; + + try + { + items = await client.Get(); + + items.ForEach(item => + { + this.Items.Add(new ItemViewModel() + { + ID = item.ID.ToString(), + LineOne = item.Title, + LineTwo = item.Uri.ToString() + }); + }); + } + catch (PocketException ex) + { + Debug.WriteLine(ex.Message); + } + + this.IsDataLoaded = true; + } + + public event PropertyChangedEventHandler PropertyChanged; + private void NotifyPropertyChanged(String propertyName) + { + PropertyChangedEventHandler handler = PropertyChanged; + if (null != handler) + { + handler(this, new PropertyChangedEventArgs(propertyName)); + } + } + } +} \ No newline at end of file diff --git a/PocketSharp.WP7/packages.config b/PocketSharp.WP7/packages.config new file mode 100644 index 0000000..53ce557 --- /dev/null +++ b/PocketSharp.WP7/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/PocketSharp.sln b/PocketSharp.sln index 97a0641..56b83a8 100644 --- a/PocketSharp.sln +++ b/PocketSharp.sln @@ -22,6 +22,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{19DD45 .nuget\NuGet.targets = .nuget\NuGet.targets EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PocketSharp.WP7", "PocketSharp.WP7\PocketSharp.WP7.csproj", "{6F542037-C48B-4EC5-A326-DDBEBF5FDFA2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -83,6 +85,16 @@ Global {CA3C491B-A8CA-426C-A0BB-E91636767467}.Release|Any CPU.Build.0 = Release|Any CPU {CA3C491B-A8CA-426C-A0BB-E91636767467}.Release|ARM.ActiveCfg = Release|Any CPU {CA3C491B-A8CA-426C-A0BB-E91636767467}.Release|x86.ActiveCfg = Release|Any CPU + {6F542037-C48B-4EC5-A326-DDBEBF5FDFA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6F542037-C48B-4EC5-A326-DDBEBF5FDFA2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6F542037-C48B-4EC5-A326-DDBEBF5FDFA2}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {6F542037-C48B-4EC5-A326-DDBEBF5FDFA2}.Debug|ARM.ActiveCfg = Debug|Any CPU + {6F542037-C48B-4EC5-A326-DDBEBF5FDFA2}.Debug|x86.ActiveCfg = Debug|Any CPU + {6F542037-C48B-4EC5-A326-DDBEBF5FDFA2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6F542037-C48B-4EC5-A326-DDBEBF5FDFA2}.Release|Any CPU.Build.0 = Release|Any CPU + {6F542037-C48B-4EC5-A326-DDBEBF5FDFA2}.Release|Any CPU.Deploy.0 = Release|Any CPU + {6F542037-C48B-4EC5-A326-DDBEBF5FDFA2}.Release|ARM.ActiveCfg = Release|Any CPU + {6F542037-C48B-4EC5-A326-DDBEBF5FDFA2}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -91,5 +103,6 @@ Global {775569C2-987F-4AC4-8BA5-A315A21ED1B7} = {AFD4E3F1-B23C-4924-BA5B-D917FBADB8FA} {656345D2-AF4C-4F88-9C9F-EBF54D7691DB} = {AFD4E3F1-B23C-4924-BA5B-D917FBADB8FA} {47721A56-2128-4C5A-8B92-995FFC353304} = {AFD4E3F1-B23C-4924-BA5B-D917FBADB8FA} + {6F542037-C48B-4EC5-A326-DDBEBF5FDFA2} = {AFD4E3F1-B23C-4924-BA5B-D917FBADB8FA} EndGlobalSection EndGlobal