Advertisement
elGuille

Código de C# del ejemplo de usar un control en dos sitios

Feb 4th, 2013
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.77 KB | None | 0 0
  1. //-----------------------------------------------------------------------------
  2. // Para hacer pruebas con aplicaciones para la Windows Store        (04/Feb/13)
  3. //
  4. // ©Guillermo 'guille' Som, 2013
  5. //-----------------------------------------------------------------------------
  6.  
  7. using System;
  8. using System.Collections.Generic;
  9. using System.IO;
  10. using System.Linq;
  11. using Windows.Foundation;
  12. using Windows.Foundation.Collections;
  13. using Windows.UI.ApplicationSettings;
  14. using Windows.UI.ViewManagement;
  15. using Windows.UI.Xaml;
  16. using Windows.UI.Xaml.Controls;
  17. using Windows.UI.Xaml.Controls.Primitives;
  18. using Windows.UI.Xaml.Data;
  19. using Windows.UI.Xaml.Input;
  20. using Windows.UI.Xaml.Media;
  21. using Windows.UI.Xaml.Navigation;
  22.  
  23. // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
  24.  
  25. namespace Prueba_AppStore
  26. {
  27.     /// <summary>
  28.     /// An empty page that can be used on its own or navigated to within a Frame.
  29.     /// </summary>
  30.     public sealed partial class MainPage : Page
  31.     {
  32.         public MainPage()
  33.         {
  34.             this.InitializeComponent();
  35.         }
  36.  
  37.         /// <summary>
  38.         /// Invoked when this page is about to be displayed in a Frame.
  39.         /// </summary>
  40.         /// <param name="e">Event data that describes how this page was reached.  The Parameter
  41.         /// property is typically used to configure the page.</param>
  42.         protected override void OnNavigatedTo(NavigationEventArgs e)
  43.         {
  44.         }
  45.  
  46.         // Añadir el botón de configuración al panel inferior    (04/Feb/13)
  47.         // para que siempre esté visible
  48.         // Pero sólo cuando se cierre la AppBar
  49.         private void mainBottomAppBar_Opened(object sender, object e)
  50.         {
  51.             spRow2.Children.Remove(buttonSettings);
  52.             spAppBarSettings.Children.Add(buttonSettings);
  53.         }
  54.  
  55.         private void mainBottomAppBar_Closed(object sender, object e)
  56.         {
  57.             spAppBarSettings.Children.Remove(buttonSettings);
  58.             spRow2.Children.Add(buttonSettings);
  59.         }
  60.  
  61.         private void buttonAlarmas_Click(object sender, RoutedEventArgs e)
  62.         {
  63.             mainBottomAppBar.IsOpen = false;
  64.  
  65.             //... resto del código
  66.         }
  67.  
  68.         private void button_Clock(object sender, RoutedEventArgs e)
  69.         {
  70.             mainBottomAppBar.IsOpen = false;
  71.  
  72.             //... resto del código
  73.         }
  74.  
  75.         private void button_Settings(object sender, RoutedEventArgs e)
  76.         {
  77.             if (ApplicationView.Value != ApplicationViewState.Snapped)
  78.             {
  79.                 SettingsPane.Show();
  80.             }
  81.         }
  82.  
  83.         private void GoBack(object sender, RoutedEventArgs e)
  84.         {
  85.             // para que esté...
  86.         }
  87.     }
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement