From: Gustavo Martin Date: Tue, 17 Jun 2014 05:04:36 +0000 (+0200) Subject: WeatherInformation: using Windows Phone toolkit X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=83b42c73ea608bc461fd04d1fb16afe8832141da;p=CSharpForFun%2F.git WeatherInformation: using Windows Phone toolkit --- diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/README_FIRST.txt b/WindowsPhone/WeatherInformation/WeatherInformation/README_FIRST.txt new file mode 100644 index 0000000..ce40c01 --- /dev/null +++ b/WindowsPhone/WeatherInformation/WeatherInformation/README_FIRST.txt @@ -0,0 +1,3 @@ +For the Windows Phone toolkit make sure that you have +marked the icons in the "Toolkit.Content" folder as content. That way they +can be used as the icons for the ApplicationBar control. \ No newline at end of file diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/Resources/AppResources.Designer.cs b/WindowsPhone/WeatherInformation/WeatherInformation/Resources/AppResources.Designer.cs index 78ffd40..0600eb5 100644 --- a/WindowsPhone/WeatherInformation/WeatherInformation/Resources/AppResources.Designer.cs +++ b/WindowsPhone/WeatherInformation/WeatherInformation/Resources/AppResources.Designer.cs @@ -1,138 +1,135 @@ //------------------------------------------------------------------------------ // // Este código fue generado por una herramienta. -// Versión de runtime:4.0.30319.17626 +// Versión de runtime:4.0.30319.34014 // // Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si // se vuelve a generar el código. // //------------------------------------------------------------------------------ -namespace WeatherInformation.Resources -{ +namespace WeatherInformation.Resources { using System; - - + + /// - /// Clase de recurso fuertemente tipado para buscar cadenas traducidas, etc. + /// Clase de recurso fuertemente tipado, para buscar cadenas traducidas, etc. /// // StronglyTypedResourceBuilder generó automáticamente esta clase // a través de una herramienta como ResGen o Visual Studio. // Para agregar o quitar un miembro, edite el archivo .ResX y, a continuación, vuelva a ejecutar ResGen - // con la opción /str o recompila tu proyecto de Visual Studio. + // con la opción /str o recompile su proyecto de VS. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class AppResources - { - + public class AppResources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal AppResources() - { + internal AppResources() { } - + /// - /// Devuelve la instancia de ResourceManager almacenada en caché usada por esta clase. + /// Devuelve la instancia de ResourceManager almacenada en caché utilizada por esta clase. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager - { - get - { - if (object.ReferenceEquals(resourceMan, null)) - { + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WeatherInformation.Resources.AppResources", typeof(AppResources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// - /// Invalida la propiedad CurrentUICulture del subproceso actual para todas las - /// búsquedas de recursos usando esta clase de recursos fuertemente tipados. + /// Reemplaza la propiedad CurrentUICulture del subproceso actual para todas las + /// búsquedas de recursos mediante esta clase de recurso fuertemente tipado. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture - { - get - { + public static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } - + /// - /// Busca una cadena traducida similar a LeftToRight. + /// Busca una cadena traducida similar a agregar. /// - public static string ResourceFlowDirection - { - get - { - return ResourceManager.GetString("ResourceFlowDirection", resourceCulture); + public static string AppBarButtonText { + get { + return ResourceManager.GetString("AppBarButtonText", resourceCulture); } } - + /// - /// Busca una cadena traducida similar a us-EN. + /// Busca una cadena traducida similar a Elemento de menú. /// - public static string ResourceLanguage - { - get - { - return ResourceManager.GetString("ResourceLanguage", resourceCulture); + public static string AppBarMenuItemText { + get { + return ResourceManager.GetString("AppBarMenuItemText", resourceCulture); } } - + /// /// Busca una cadena traducida similar a MI APLICACIÓN. /// - public static string ApplicationTitle - { - get - { + public static string ApplicationTitle { + get { return ResourceManager.GetString("ApplicationTitle", resourceCulture); } } - + /// - /// Busca una cadena traducida similar a Valor de propiedad en tiempo de ejecución de ejemplo. + /// Busca una cadena traducida similar a Language. /// - public static string SampleProperty - { - get - { - return ResourceManager.GetString("SampleProperty", resourceCulture); + public static string LanguageSettingsText { + get { + return ResourceManager.GetString("LanguageSettingsText", resourceCulture); } } - + /// - /// Busca una cadena traducida similar al texto del botón. + /// Busca una cadena traducida similar a LeftToRight. /// - public static string AppBarButtonText - { - get - { - return ResourceManager.GetString("AppBarButtonText", resourceCulture); + public static string ResourceFlowDirection { + get { + return ResourceManager.GetString("ResourceFlowDirection", resourceCulture); } } - + /// - /// Busca una cadena traducida similar a elemento de menú. + /// Busca una cadena traducida similar a es-ES. /// - public static string AppBarMenuItemText - { - get - { - return ResourceManager.GetString("AppBarMenuItemText", resourceCulture); + public static string ResourceLanguage { + get { + return ResourceManager.GetString("ResourceLanguage", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Valor de propiedad en tiempo de ejecución de ejemplo. + /// + public static string SampleProperty { + get { + return ResourceManager.GetString("SampleProperty", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Temperature units. + /// + public static string TemperatureSettingsText { + get { + return ResourceManager.GetString("TemperatureSettingsText", resourceCulture); } } } -} \ No newline at end of file +} diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/Resources/AppResources.resx b/WindowsPhone/WeatherInformation/WeatherInformation/Resources/AppResources.resx index 7f350d6..10bd5a6 100644 --- a/WindowsPhone/WeatherInformation/WeatherInformation/Resources/AppResources.resx +++ b/WindowsPhone/WeatherInformation/WeatherInformation/Resources/AppResources.resx @@ -1,17 +1,17 @@  - @@ -137,4 +137,12 @@ Elemento de menú + + Language + Text in settings page + + + Temperature units + Text in settings page + \ No newline at end of file diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/SettingsPage.xaml b/WindowsPhone/WeatherInformation/WeatherInformation/SettingsPage.xaml index 0095553..f75296e 100644 --- a/WindowsPhone/WeatherInformation/WeatherInformation/SettingsPage.xaml +++ b/WindowsPhone/WeatherInformation/WeatherInformation/SettingsPage.xaml @@ -6,6 +6,7 @@ xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" mc:Ignorable="d" d:DataContext="{d:DesignData SampleData/SettingsViewModelSampleData.xaml}" FontFamily="{StaticResource PhoneFontFamilyNormal}" @@ -20,40 +21,38 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + + - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/SettingsPage.xaml.cs b/WindowsPhone/WeatherInformation/WeatherInformation/SettingsPage.xaml.cs index 194be6a..df7243f 100644 --- a/WindowsPhone/WeatherInformation/WeatherInformation/SettingsPage.xaml.cs +++ b/WindowsPhone/WeatherInformation/WeatherInformation/SettingsPage.xaml.cs @@ -28,24 +28,5 @@ namespace WeatherInformation App.SettingsViewModel.LoadData(); } } - - private void LongListSelector_SelectionChanged(object sender, SelectionChangedEventArgs e) - { - LongListSelector selector = sender as LongListSelector; - ItemViewModel item = selector.SelectedItem as ItemViewModel; - switch(item.LineOne) - { - case "Temperature units": - NavigationService.Navigate(new Uri("/SettingsTemperatureUnitsPage.xaml", UriKind.Relative)); - break; - default: - break; - } - } - - private void StackPanel_Tap(object sender, System.Windows.Input.GestureEventArgs e) - { - - } } } \ No newline at end of file diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/SettingsTemperatureUnitsPage.xaml b/WindowsPhone/WeatherInformation/WeatherInformation/SettingsTemperatureUnitsPage.xaml deleted file mode 100644 index 9af9e90..0000000 --- a/WindowsPhone/WeatherInformation/WeatherInformation/SettingsTemperatureUnitsPage.xaml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/SettingsTemperatureUnitsPage.xaml.cs b/WindowsPhone/WeatherInformation/WeatherInformation/SettingsTemperatureUnitsPage.xaml.cs deleted file mode 100644 index fbb95d6..0000000 --- a/WindowsPhone/WeatherInformation/WeatherInformation/SettingsTemperatureUnitsPage.xaml.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Navigation; -using Microsoft.Phone.Controls; -using Microsoft.Phone.Shell; - -namespace WeatherInformation -{ - public partial class SettingsTemperatureUnitsPage : PhoneApplicationPage - { - public SettingsTemperatureUnitsPage() - { - InitializeComponent(); - - // Establecer el contexto de datos del control ListBox control en los datos de ejemplo - DataContext = App.TemperatureUnitsViewModel; - } - - protected override void OnNavigatedTo(NavigationEventArgs e) - { - if (!App.TemperatureUnitsViewModel.IsDataLoaded) - { - App.TemperatureUnitsViewModel.LoadData(); - } - } - } -} \ No newline at end of file diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/Toolkit.Content/ApplicationBar.Add.png b/WindowsPhone/WeatherInformation/WeatherInformation/Toolkit.Content/ApplicationBar.Add.png new file mode 100644 index 0000000..4b524d6 Binary files /dev/null and b/WindowsPhone/WeatherInformation/WeatherInformation/Toolkit.Content/ApplicationBar.Add.png differ diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/Toolkit.Content/ApplicationBar.Cancel.png b/WindowsPhone/WeatherInformation/WeatherInformation/Toolkit.Content/ApplicationBar.Cancel.png new file mode 100644 index 0000000..4dd724f Binary files /dev/null and b/WindowsPhone/WeatherInformation/WeatherInformation/Toolkit.Content/ApplicationBar.Cancel.png differ diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/Toolkit.Content/ApplicationBar.Check.png b/WindowsPhone/WeatherInformation/WeatherInformation/Toolkit.Content/ApplicationBar.Check.png new file mode 100644 index 0000000..7a07466 Binary files /dev/null and b/WindowsPhone/WeatherInformation/WeatherInformation/Toolkit.Content/ApplicationBar.Check.png differ diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/Toolkit.Content/ApplicationBar.Delete.png b/WindowsPhone/WeatherInformation/WeatherInformation/Toolkit.Content/ApplicationBar.Delete.png new file mode 100644 index 0000000..95bb16d Binary files /dev/null and b/WindowsPhone/WeatherInformation/WeatherInformation/Toolkit.Content/ApplicationBar.Delete.png differ diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/Toolkit.Content/ApplicationBar.Select.png b/WindowsPhone/WeatherInformation/WeatherInformation/Toolkit.Content/ApplicationBar.Select.png new file mode 100644 index 0000000..995deaa Binary files /dev/null and b/WindowsPhone/WeatherInformation/WeatherInformation/Toolkit.Content/ApplicationBar.Select.png differ diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/WeatherInformation.csproj b/WindowsPhone/WeatherInformation/WeatherInformation/WeatherInformation.csproj index db4c845..e5f2f97 100644 --- a/WindowsPhone/WeatherInformation/WeatherInformation/WeatherInformation.csproj +++ b/WindowsPhone/WeatherInformation/WeatherInformation/WeatherInformation.csproj @@ -125,9 +125,6 @@ SettingsPage.xaml - - SettingsTemperatureUnitsPage.xaml - @@ -162,10 +159,6 @@ Designer MSBuild:Compile - - Designer - MSBuild:Compile - @@ -196,6 +189,12 @@ + + + + + + @@ -205,6 +204,9 @@ + + ..\packages\WPtoolkit.4.2013.08.16\lib\wp8\Microsoft.Phone.Controls.Toolkit.dll + ..\packages\Newtonsoft.Json.6.0.3\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/packages.config b/WindowsPhone/WeatherInformation/WeatherInformation/packages.config index b1d93b5..226e900 100644 --- a/WindowsPhone/WeatherInformation/WeatherInformation/packages.config +++ b/WindowsPhone/WeatherInformation/WeatherInformation/packages.config @@ -1,4 +1,5 @@  + \ No newline at end of file