Ejemplo n.º 1
0
        public HomePage()
        {
            _userPageViewModel = new UserPageViewModel();

            this.InitializeComponent();
            this.DataContext         = _userPageViewModel;
            this.NavigationCacheMode = NavigationCacheMode.Required;
            NavPane.InitializeDrawerLayout();
            Windows.UI.ViewManagement.StatusBar.GetForCurrentView().BackgroundColor = Color.FromArgb(1, 78, 101, 135);

            resourceLoader = new ResourceLoader();

            //TMP MOCKED MENU
            List <string> menuItemsTop = new List <string> {
                ResourceLoader.GetForCurrentView().GetString("Home"), ResourceLoader.GetForCurrentView().GetString("Followers")
            };

            MenuItems.ItemsSource = menuItemsTop;

            List <string> menuItemsBottom = new List <string> {
                ResourceLoader.GetForCurrentView().GetString("Settings"), ResourceLoader.GetForCurrentView().GetString("Login")
            };

            MenuItemsBottom.ItemsSource = menuItemsBottom;
        }
Ejemplo n.º 2
0
 private void SearchBox_Tapped(object sender, TappedRoutedEventArgs e)
 {
     if (NavPane.IsDrawerOpen)
     {
         NavPane.CloseDrawer();
     }
 }
Ejemplo n.º 3
0
        public override void PersistLayout()
        {
#if USE_DOTNETBAR
            NavPane.SaveLayout(LayoutPersistPath);
#else
            // use MyPanel
#endif
        }
Ejemplo n.º 4
0
 private void MenuItems_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (MenuItems.SelectedItem != null)
     {
         var selecteditem = MenuItems.SelectedValue as string;
         NavPane.CloseDrawer();
         MenuItems.SelectedItem = null;
     }
 }
Ejemplo n.º 5
0
 private void MenuIcon_Tapped(object sender, TappedRoutedEventArgs e)
 {
     if (NavPane.IsDrawerOpen)
     {
         NavPane.CloseDrawer();
     }
     else
     {
         NavPane.OpenDrawer();
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// get the location/settings of various widgets so that we can restore them
 /// </summary>
 protected void DepersistLayout()
 {
     if (System.IO.File.Exists(LayoutPersistPath))
     {
         try
         {
             NavPane.LoadLayout(LayoutPersistPath);
         }
         catch (Exception)
         {}
     }
 }
Ejemplo n.º 7
0
 void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
 {
     if (NavPane.IsDrawerOpen)
     {
         NavPane.CloseDrawer();
         e.Handled = true;
     }
     else
     {
         Application.Current.Exit();
     }
 }
Ejemplo n.º 8
0
        protected void LoadAreaButtons(ChoiceGroup group)
        {
            NavPane.SuspendLayout();
            NavPane.Items.Clear();

            foreach (ChoiceRelatedClass item in group)
            {
                //Debug.Assert(item is ChoiceBase, "Only things that can be made into buttons should be appearing here.");
                Debug.Assert(item is ListPropertyChoice, "Only things that can be made into buttons should be appearing here.");
                MakeAreaButton((ListPropertyChoice)item);
            }
            NavPane.ResumeLayout(true);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// get the location/settings of various widgets so that we can restore them
        /// </summary>
        protected void DepersistLayout()
        {
#if USE_DOTNETBAR
            if (System.IO.File.Exists(LayoutPersistPath))
            {
                try
                {
                    NavPane.LoadLayout(LayoutPersistPath);
                }
                catch (Exception)
                {}
            }
#else
            // use MyPanel
#endif
        }
Ejemplo n.º 10
0
        private async void SearchIcon_Tapped(object sender, TappedRoutedEventArgs e)
        {
            if (NavPane.IsDrawerOpen)
            {
                NavPane.CloseDrawer();
            }

            if (SearchBox.Visibility == Visibility.Collapsed)
            {
                SearchBox.Visibility      = Visibility.Visible;
                MainPageHeader.Visibility = Visibility.Collapsed;
            }
            else
            {
                SearchBox.Visibility      = Visibility.Collapsed;
                MainPageHeader.Visibility = Visibility.Visible;
            }
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => SearchBox.Focus(FocusState.Keyboard));
        }