diff options
Diffstat (limited to 'Juick')
-rw-r--r-- | Juick/Classes/TileHelper.cs | 130 | ||||
-rw-r--r-- | Juick/Controls/MessageList.xaml | 63 | ||||
-rw-r--r-- | Juick/Juick.csproj | 98 | ||||
-rw-r--r-- | Juick/Properties/AssemblyInfo.cs | 4 | ||||
-rw-r--r-- | Juick/Properties/WMAppManifest.xml | 33 | ||||
-rw-r--r-- | Juick/Toolkit.Content/ApplicationBar.Add.png | bin | 339 -> 0 bytes | |||
-rw-r--r-- | Juick/Toolkit.Content/ApplicationBar.Cancel.png | bin | 350 -> 0 bytes | |||
-rw-r--r-- | Juick/Toolkit.Content/ApplicationBar.Check.png | bin | 414 -> 0 bytes | |||
-rw-r--r-- | Juick/Toolkit.Content/ApplicationBar.Delete.png | bin | 445 -> 0 bytes | |||
-rw-r--r-- | Juick/Toolkit.Content/ApplicationBar.Select.png | bin | 863 -> 0 bytes | |||
-rw-r--r-- | Juick/ViewModels/PageViewModel.cs | 165 | ||||
-rw-r--r-- | Juick/packages.config | 3 |
12 files changed, 261 insertions, 235 deletions
diff --git a/Juick/Classes/TileHelper.cs b/Juick/Classes/TileHelper.cs index 223340b..aa26690 100644 --- a/Juick/Classes/TileHelper.cs +++ b/Juick/Classes/TileHelper.cs @@ -1,78 +1,52 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Microsoft.Phone.Shell; - -namespace Juick.Classes -{ - static class TileHelper - { - public static void UpdateFlipTile( - string title, - string backTitle, - string backContent, - string wideBackContent, - int? count, - string smallBackgroundImageStringUri, - string backgroundImageStringUri, - string backBackgroundImageStringUri, - string wideBackgroundImageStringUri, - string wideBackBackgroundImageStringUri) - { - if (!CanUseLiveTiles) - { - return; - } - var smallBackgroundImage = CreateRelativeUri(smallBackgroundImageStringUri); - var backgroundImage = CreateRelativeUri(backgroundImageStringUri); - var backBackgroundImage = CreateRelativeUri(backBackgroundImageStringUri); - var wideBackgroundImage = CreateRelativeUri(wideBackgroundImageStringUri); - var wideBackBackgroundImage = CreateRelativeUri(wideBackBackgroundImageStringUri); - - Type flipTileDataType = Type.GetType("Microsoft.Phone.Shell.FlipTileData, Microsoft.Phone"); - - // Get the ShellTile type so we can call the new version of "Update" that takes the new Tile templates. - Type shellTileType = Type.GetType("Microsoft.Phone.Shell.ShellTile, Microsoft.Phone"); - - // Loop through any existing Tiles that are pinned to Start. - foreach (var tileToUpdate in ShellTile.ActiveTiles) - { - var UpdateTileData = flipTileDataType.GetConstructor(new Type[] { }).Invoke(null); - - // Set the properties. - SetProperty(UpdateTileData, "Title", title); - SetProperty(UpdateTileData, "Count", count); - SetProperty(UpdateTileData, "BackTitle", backTitle); - SetProperty(UpdateTileData, "BackContent", backContent); - SetProperty(UpdateTileData, "SmallBackgroundImage", smallBackgroundImage); - SetProperty(UpdateTileData, "BackgroundImage", backgroundImage); - SetProperty(UpdateTileData, "BackBackgroundImage", backBackgroundImage); - SetProperty(UpdateTileData, "WideBackgroundImage", wideBackgroundImage); - SetProperty(UpdateTileData, "WideBackBackgroundImage", wideBackBackgroundImage); - SetProperty(UpdateTileData, "WideBackContent", wideBackContent); - - // Invoke the new version of ShellTile.Update. - shellTileType.GetMethod("Update").Invoke(tileToUpdate, new Object[] { UpdateTileData }); - } - } - - static Uri CreateRelativeUri(string uriString) - { - return !string.IsNullOrEmpty(uriString) ? new Uri(uriString, UriKind.Relative) : null; - } - - static void SetProperty(object instance, string name, object value) - { - var setMethod = instance.GetType().GetProperty(name).GetSetMethod(); - setMethod.Invoke(instance, new object[] { value }); - } - - static readonly Version targetedVersion78 = new Version(7, 10, 8858); - - static bool CanUseLiveTiles - { - get { return Environment.OSVersion.Version >= targetedVersion78; } - } - } -} +using System;
+using Microsoft.Phone.Shell;
+
+namespace Juick.Classes
+{
+ static class TileHelper
+ {
+ public static void UpdateFlipTile(
+ string title,
+ string backTitle,
+ string backContent,
+ string wideBackContent,
+ int? count,
+ string smallBackgroundImageStringUri,
+ string backgroundImageStringUri,
+ string backBackgroundImageStringUri,
+ string wideBackgroundImageStringUri,
+ string wideBackBackgroundImageStringUri)
+ {
+ var smallBackgroundImage = CreateRelativeUri(smallBackgroundImageStringUri);
+ var backgroundImage = CreateRelativeUri(backgroundImageStringUri);
+ var backBackgroundImage = CreateRelativeUri(backBackgroundImageStringUri);
+ var wideBackgroundImage = CreateRelativeUri(wideBackgroundImageStringUri);
+ var wideBackBackgroundImage = CreateRelativeUri(wideBackBackgroundImageStringUri);
+
+ // Loop through any existing Tiles that are pinned to Start.
+ foreach (var tileToUpdate in ShellTile.ActiveTiles)
+ {
+ var updateTileData = new FlipTileData
+ {
+ Title = title,
+ Count = count,
+ BackTitle = backTitle,
+ BackContent = backContent,
+ SmallBackgroundImage = smallBackgroundImage,
+ BackgroundImage = backgroundImage,
+ BackBackgroundImage = backBackgroundImage,
+ WideBackgroundImage = wideBackgroundImage,
+ WideBackBackgroundImage = wideBackBackgroundImage,
+ WideBackContent = wideBackContent
+ };
+
+ tileToUpdate.Update(updateTileData);
+ }
+ }
+
+ static Uri CreateRelativeUri(string uriString)
+ {
+ return !string.IsNullOrEmpty(uriString) ? new Uri(uriString, UriKind.Relative) : null;
+ }
+ }
+}
diff --git a/Juick/Controls/MessageList.xaml b/Juick/Controls/MessageList.xaml index af23c5a..93dd08f 100644 --- a/Juick/Controls/MessageList.xaml +++ b/Juick/Controls/MessageList.xaml @@ -1,32 +1,31 @@ -<UserControl x:Class="Juick.Controls.MessageList" - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:bindings="clr-namespace:Juick.Classes" - xmlns:usercontrols="clr-namespace:Juick.Controls" - xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" - mc:Ignorable="d" - xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" - FontFamily="{StaticResource PhoneFontFamilyNormal}" - FontSize="{StaticResource PhoneFontSizeNormal}" - Foreground="{StaticResource PhoneForegroundBrush}" - d:DesignHeight="480" d:DesignWidth="480"> - - <Grid x:Name="LayoutRoot"> - <toolkit:LongListSelector Margin="0, 0, -12, 0" - ItemsSource="{Binding Items}" IsFlatList="true" ItemTemplate="{StaticResource PostItemDataTemplate}" - SelectionChanged="LongListSelector_SelectionChanged"> - <i:Interaction.Triggers> - <i:EventTrigger EventName="Link"> - <bindings:InvokeDelegateCommandAction Command="{Binding LoadMessagesPageCommand}" - CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=InvokeParameter}"/> - </i:EventTrigger> - <i:EventTrigger EventName="SelectionChanged"> - <bindings:InvokeDelegateCommandAction Command="{Binding NavigateNextCommand}" - CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=InvokeParameter}"/> - </i:EventTrigger> - </i:Interaction.Triggers> - </toolkit:LongListSelector> - </Grid> -</UserControl> +<UserControl x:Class="Juick.Controls.MessageList"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:bindings="clr-namespace:Juick.Classes"
+ xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
+ xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
+ mc:Ignorable="d"
+ FontFamily="{StaticResource PhoneFontFamilyNormal}"
+ FontSize="{StaticResource PhoneFontSizeNormal}"
+ Foreground="{StaticResource PhoneForegroundBrush}"
+ d:DesignHeight="480" d:DesignWidth="480">
+
+ <Grid x:Name="LayoutRoot">
+ <phone:LongListSelector Margin="0, 0, -12, 0"
+ ItemsSource="{Binding Items}" LayoutMode="List" IsGroupingEnabled="False" ItemTemplate="{StaticResource PostItemDataTemplate}"
+ >
+ <i:Interaction.Triggers>
+ <i:EventTrigger EventName="ItemRealized">
+ <bindings:InvokeDelegateCommandAction Command="{Binding LoadMessagesPageCommand}"
+ CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=InvokeParameter}"/>
+ </i:EventTrigger>
+ <i:EventTrigger EventName="Tap">
+ <bindings:InvokeDelegateCommandAction Command="{Binding NavigateNextCommand}"
+ CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=InvokeParameter}"/>
+ </i:EventTrigger>
+ </i:Interaction.Triggers>
+ </phone:LongListSelector>
+ </Grid>
+</UserControl>
diff --git a/Juick/Juick.csproj b/Juick/Juick.csproj index 0125586..dd4c351 100644 --- a/Juick/Juick.csproj +++ b/Juick/Juick.csproj @@ -11,16 +11,18 @@ <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Juick</RootNamespace>
<AssemblyName>Juick</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
- <TargetFrameworkProfile>WindowsPhone71</TargetFrameworkProfile>
- <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
+ <SilverlightVersion>
+ </SilverlightVersion>
+ <TargetFrameworkProfile>
+ </TargetFrameworkProfile>
+ <TargetFrameworkIdentifier>WindowsPhone</TargetFrameworkIdentifier>
<SilverlightApplication>true</SilverlightApplication>
<SupportedCultures>
</SupportedCultures>
<XapOutputs>true</XapOutputs>
<GenerateSilverlightManifest>true</GenerateSilverlightManifest>
- <XapFilename>Juick.xap</XapFilename>
+ <XapFilename>Juick_$(Configuration)_$(Platform).xap</XapFilename>
<SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
<SilverlightAppEntry>Juick.App</SilverlightAppEntry>
<ValidateXaml>true</ValidateXaml>
@@ -29,6 +31,7 @@ <RestorePackages>true</RestorePackages>
<Utf8Output>true</Utf8Output>
<ExpressionBlendVersion>4.0.30816.0</ExpressionBlendVersion>
+ <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -40,6 +43,7 @@ <NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
+ <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -51,30 +55,63 @@ <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RunCodeAnalysis>true</RunCodeAnalysis>
+ <Prefer32Bit>false</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>Bin\x86\Debug</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <DebugType>full</DebugType>
+ <PlatformTarget>
+ </PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ <Optimize>false</Optimize>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+ <OutputPath>Bin\x86\Release</OutputPath>
+ <DefineConstants>CODE_ANALYSIS;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <Optimize>true</Optimize>
+ <NoStdLib>true</NoStdLib>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>
+ </PlatformTarget>
+ <RunCodeAnalysis>true</RunCodeAnalysis>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>Bin\ARM\Debug</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <DebugType>full</DebugType>
+ <PlatformTarget>
+ </PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ <Optimize>false</Optimize>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
+ <OutputPath>Bin\ARM\Release</OutputPath>
+ <DefineConstants>CODE_ANALYSIS;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <Optimize>true</Optimize>
+ <NoStdLib>true</NoStdLib>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>
+ </PlatformTarget>
+ <RunCodeAnalysis>true</RunCodeAnalysis>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Microsoft.Phone" />
- <Reference Include="Microsoft.Phone.Controls" />
- <Reference Include="Microsoft.Phone.Controls.Toolkit, Version=7.0.1.0, Culture=neutral, PublicKeyToken=b772ad94eb9ca604, processorArchitecture=MSIL">
+ <Reference Include="Microsoft.Phone.Controls, Version=8.0.0.0, Culture=neutral, PublicKeyToken=24eec0d8c86cda1e, processorArchitecture=MSIL" />
+ <Reference Include="RestSharp.WindowsPhone, Version=104.4.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\WPtoolkit.4.2013.08.16\lib\sl4-windowsphone71\Microsoft.Phone.Controls.Toolkit.dll</HintPath>
+ <HintPath>..\packages\RestSharp.104.4.0\lib\sl4-wp71\RestSharp.WindowsPhone.dll</HintPath>
</Reference>
- <Reference Include="Microsoft.Phone.Interop" />
- <Reference Include="Microsoft.Xna.Framework" />
- <Reference Include="RestSharp.WindowsPhone, Version=104.3.3.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\RestSharp.104.3.3\lib\sl4-wp71\RestSharp.WindowsPhone.dll</HintPath>
- </Reference>
- <Reference Include="System.Runtime.Serialization" />
- <Reference Include="System.Servicemodel.Web" />
- <Reference Include="System.Windows" />
- <Reference Include="system" />
- <Reference Include="System.Core" />
- <Reference Include="System.Net" />
<Reference Include="System.Windows.Interactivity, Version=3.8.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="System.Xml" />
- <Reference Include="mscorlib.extensions" />
- <Reference Include="System.Xml.Serialization" />
</ItemGroup>
<ItemGroup>
<Compile Include="Api\Message.cs" />
@@ -155,7 +192,9 @@ </Page>
</ItemGroup>
<ItemGroup>
- <None Include="packages.config" />
+ <None Include="packages.config">
+ <SubType>Designer</SubType>
+ </None>
<None Include="Properties\AppManifest.xml" />
<None Include="Properties\WMAppManifest.xml">
<SubType>Designer</SubType>
@@ -165,11 +204,6 @@ <Content Include="ApplicationIcon.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="Toolkit.Content\ApplicationBar.Add.png" />
- <Content Include="Toolkit.Content\ApplicationBar.Cancel.png" />
- <Content Include="Toolkit.Content\ApplicationBar.Check.png" />
- <Content Include="Toolkit.Content\ApplicationBar.Delete.png" />
- <Content Include="Toolkit.Content\ApplicationBar.Select.png" />
<Resource Include="Images\appbar.add.rest.png" />
<Resource Include="Images\appbar.back.rest.png" />
<Resource Include="Images\appbar.basecircle.rest.png" />
@@ -215,8 +249,8 @@ </DesignData>
</ItemGroup>
<ItemGroup />
- <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets" />
- <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.CSharp.targets" />
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).$(TargetFrameworkVersion).Overrides.targets" />
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).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">
diff --git a/Juick/Properties/AssemblyInfo.cs b/Juick/Properties/AssemblyInfo.cs index a054912..928036d 100644 --- a/Juick/Properties/AssemblyInfo.cs +++ b/Juick/Properties/AssemblyInfo.cs @@ -32,6 +32,6 @@ using System.Resources; //
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
-[assembly: AssemblyVersion("1.1.2.*")]
-[assembly: AssemblyFileVersion("1.1.2.*")]
+[assembly: AssemblyVersion("2.0.0.1")]
+[assembly: AssemblyFileVersion("2.0.0.1")]
[assembly: NeutralResourcesLanguageAttribute("en-US")]
diff --git a/Juick/Properties/WMAppManifest.xml b/Juick/Properties/WMAppManifest.xml index cf6c5ef..68d520d 100644 --- a/Juick/Properties/WMAppManifest.xml +++ b/Juick/Properties/WMAppManifest.xml @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="utf-8"?>
-<Deployment xmlns="http://schemas.microsoft.com/windowsphone/2009/deployment" AppPlatformVersion="7.1">
- <App xmlns="" ProductID="{c0b72e47-109a-478a-af50-75937b8af908}" Title="Juick" RuntimeType="Silverlight" Version="1.1.2.0" Genre="apps.normal" Author="Juick author" Description="Sample description" Publisher="Juick">
+<Deployment xmlns="http://schemas.microsoft.com/windowsphone/2012/deployment" AppPlatformVersion="8.0">
+ <DefaultLanguage xmlns="" code="en-US" />
+ <App xmlns="" ProductID="{ba7895cf-3f11-4459-9f91-6fe7df26e202}" Title="Juick" RuntimeType="Silverlight" Version="2.0.0.1" Genre="apps.normal" Author="Juick author" Description="Sample description" Publisher="Juick" PublisherID="{bfbcb16e-c78a-4595-afc6-6ada592f1adc}">
<IconPath IsRelative="true" IsResource="false">ApplicationIcon.png</IconPath>
<Capabilities>
<Capability Name="ID_CAP_GAMERSERVICES" />
<Capability Name="ID_CAP_IDENTITY_DEVICE" />
<Capability Name="ID_CAP_IDENTITY_USER" />
<Capability Name="ID_CAP_LOCATION" />
- <Capability Name="ID_CAP_MEDIALIB" />
<Capability Name="ID_CAP_MICROPHONE" />
<Capability Name="ID_CAP_NETWORKING" />
<Capability Name="ID_CAP_PHONEDIALER" />
@@ -17,17 +17,31 @@ <Capability Name="ID_CAP_ISV_CAMERA" />
<Capability Name="ID_CAP_CONTACTS" />
<Capability Name="ID_CAP_APPOINTMENTS" />
+ <Capability Name="ID_CAP_MEDIALIB_AUDIO" />
+ <Capability Name="ID_CAP_MEDIALIB_PHOTO" />
+ <Capability Name="ID_CAP_MEDIALIB_PLAYBACK" />
+ <Capability Name="ID_CAP_REMOVABLE_STORAGE" />
</Capabilities>
<Tasks>
- <DefaultTask Name="_default" NavigationPage="MainPage.xaml" />
+ <DefaultTask Name="_default" NavigationPage="MainPage.xaml" />
</Tasks>
<Tokens>
<PrimaryToken TokenID="JuickToken" TaskName="_default">
- <TemplateType5>
- <BackgroundImageURI IsRelative="true" IsResource="false">ApplicationTile.png</BackgroundImageURI>
+ <TemplateFlip>
+ <SmallImageURI IsResource="false" IsRelative="true">ApplicationTile.png</SmallImageURI>
<Count>0</Count>
+ <BackgroundImageURI IsResource="false" IsRelative="true">ApplicationTile.png</BackgroundImageURI>
<Title>Juick</Title>
- </TemplateType5>
+ <BackContent>
+ </BackContent>
+ <BackBackgroundImageURI>
+ </BackBackgroundImageURI>
+ <BackTitle>
+ </BackTitle>
+ <DeviceLockImageURI>
+ </DeviceLockImageURI>
+ <HasLarge>False</HasLarge>
+ </TemplateFlip>
</PrimaryToken>
</Tokens>
<Extensions>
@@ -36,5 +50,10 @@ <!--<AppExtra xmlns="" AppPlatformVersion="8.0">
<Extra Name="Tiles"/>
</AppExtra>-->
+ <ScreenResolutions>
+ <ScreenResolution Name="ID_RESOLUTION_WVGA" />
+ <ScreenResolution Name="ID_RESOLUTION_WXGA" />
+ <ScreenResolution Name="ID_RESOLUTION_HD720P" />
+ </ScreenResolutions>
</App>
</Deployment>
\ No newline at end of file diff --git a/Juick/Toolkit.Content/ApplicationBar.Add.png b/Juick/Toolkit.Content/ApplicationBar.Add.png Binary files differdeleted file mode 100644 index 4b524d6..0000000 --- a/Juick/Toolkit.Content/ApplicationBar.Add.png +++ /dev/null diff --git a/Juick/Toolkit.Content/ApplicationBar.Cancel.png b/Juick/Toolkit.Content/ApplicationBar.Cancel.png Binary files differdeleted file mode 100644 index 4dd724f..0000000 --- a/Juick/Toolkit.Content/ApplicationBar.Cancel.png +++ /dev/null diff --git a/Juick/Toolkit.Content/ApplicationBar.Check.png b/Juick/Toolkit.Content/ApplicationBar.Check.png Binary files differdeleted file mode 100644 index 7a07466..0000000 --- a/Juick/Toolkit.Content/ApplicationBar.Check.png +++ /dev/null diff --git a/Juick/Toolkit.Content/ApplicationBar.Delete.png b/Juick/Toolkit.Content/ApplicationBar.Delete.png Binary files differdeleted file mode 100644 index 95bb16d..0000000 --- a/Juick/Toolkit.Content/ApplicationBar.Delete.png +++ /dev/null diff --git a/Juick/Toolkit.Content/ApplicationBar.Select.png b/Juick/Toolkit.Content/ApplicationBar.Select.png Binary files differdeleted file mode 100644 index 995deaa..0000000 --- a/Juick/Toolkit.Content/ApplicationBar.Select.png +++ /dev/null diff --git a/Juick/ViewModels/PageViewModel.cs b/Juick/ViewModels/PageViewModel.cs index 0d57f6a..9781a9e 100644 --- a/Juick/ViewModels/PageViewModel.cs +++ b/Juick/ViewModels/PageViewModel.cs @@ -1,82 +1,83 @@ -using System; -using System.Linq; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Net; -using System.Windows; -using Juick.Classes; -using JuickApi; -using RestSharp; -using Microsoft.Phone.Controls; -using System.Windows.Controls; - -namespace Juick.ViewModels -{ - public class PageViewModel : ViewModelBase - { - public PageViewModel(AppViewModel context) - { - _context = context; - Items = new ObservableCollection<PostItem>(); - LoadMessagesPageCommand = new DelegateCommand<LinkUnlinkEventArgs>(CheckNewData, () => !context.IsDataLoading); - NavigateNextCommand = new DelegateCommand<SelectionChangedEventArgs>(NavigateToThread, () => true); - } - - private readonly AppViewModel _context; - private string _restUri; - - public string RestUri - { - get { return _restUri; } - set - { - _restUri = value; - } - } - - public virtual string Caption { get; set; } - - public ObservableCollection<PostItem> Items { get; private set; } - - public DelegateCommand<LinkUnlinkEventArgs> LoadMessagesPageCommand { get; private set; } - - public DelegateCommand<SelectionChangedEventArgs> NavigateNextCommand { get; private set; } - - public void NavigateToThread(SelectionChangedEventArgs param) - { - if (param == null) return; - if (param.AddedItems.Count > 0) - ((App)Application.Current).NavigateTo( - new Uri(string.Format("/ThreadView.xaml?mid={0}", ((PostItem)param.AddedItems[0]).MID), UriKind.Relative)); - } - - public void CheckNewData(LinkUnlinkEventArgs e) - { - const int offset = 5; - if (e == null) return; - var item = e.ContentPresenter.Content; - if (item.Equals(Items[Items.Count - offset])) { - RefreshData(); - } - } - - public void RefreshData() - { - var requestUri = RestUri + "&rnd=" + Environment.TickCount; - if (Items.Count > 0) - { - requestUri += string.Format("&before_mid={0}", Items[Items.Count - 1].MID); - } - - var request = new RestRequest(requestUri); - _context.Client.ExecuteAsync<List<Message>>(request, response => - { - _context.IsDataLoading = false; - if (response.Data == null) - return; - response.Data.Select(x => new PostItem(x)).ToList().ForEach(i => Items.Add(i)); - }); - _context.IsDataLoading = true; - } - } -} +using System;
+using System.Linq;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+using Juick.Classes;
+using JuickApi;
+using RestSharp;
+using Microsoft.Phone.Controls;
+
+namespace Juick.ViewModels
+{
+ public class PageViewModel : ViewModelBase
+ {
+ public PageViewModel(AppViewModel context)
+ {
+ _context = context;
+ Items = new ObservableCollection<PostItem>();
+ LoadMessagesPageCommand = new DelegateCommand<ItemRealizationEventArgs>(CheckNewData, () => !context.IsDataLoading);
+ NavigateNextCommand = new DelegateCommand<GestureEventArgs>(NavigateToThread, () => true);
+ }
+
+ private readonly AppViewModel _context;
+ private string _restUri;
+
+ public string RestUri
+ {
+ get { return _restUri; }
+ set
+ {
+ _restUri = value;
+ }
+ }
+
+ public virtual string Caption { get; set; }
+
+ public ObservableCollection<PostItem> Items { get; private set; }
+
+ public DelegateCommand<ItemRealizationEventArgs> LoadMessagesPageCommand { get; private set; }
+
+ public DelegateCommand<GestureEventArgs> NavigateNextCommand { get; private set; }
+
+ public void NavigateToThread(GestureEventArgs param)
+ {
+ PostItem post = ((FrameworkElement)param.OriginalSource).DataContext as PostItem;
+
+ if (post != null)
+ ((App)Application.Current).NavigateTo(
+ new Uri(string.Format("/ThreadView.xaml?mid={0}", post.MID), UriKind.Relative));
+ }
+
+ public void CheckNewData(ItemRealizationEventArgs e)
+ {
+ const int offset = 5;
+ if (e == null) return;
+ var item = e.Container.Content;
+ if (item.Equals(Items[Items.Count - offset])) {
+ RefreshData();
+ }
+ }
+
+ public void RefreshData()
+ {
+ var requestUri = RestUri + "&rnd=" + Environment.TickCount;
+ if (Items.Count > 0)
+ {
+ requestUri += string.Format("&before_mid={0}", Items[Items.Count - 1].MID);
+ }
+
+ var request = new RestRequest(requestUri);
+ _context.Client.ExecuteAsync<List<Message>>(request, response =>
+ {
+ _context.IsDataLoading = false;
+ if (response.Data == null)
+ return;
+ response.Data.Select(x => new PostItem(x)).ToList().ForEach(i => Items.Add(i));
+ });
+ _context.IsDataLoading = true;
+ }
+ }
+}
diff --git a/Juick/packages.config b/Juick/packages.config index 97ef741..7999f81 100644 --- a/Juick/packages.config +++ b/Juick/packages.config @@ -1,5 +1,4 @@ <?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="RestSharp" version="104.3.3" targetFramework="wp71" />
- <package id="WPtoolkit" version="4.2013.08.16" targetFramework="wp71" />
+ <package id="RestSharp" version="104.4.0" targetFramework="wp80" />
</packages>
\ No newline at end of file |