Esempio n. 1
0
        private async void InvokeContent(NavigationItem navItem)
        {
            if (_splitView.IsPaneOpen)
            {
                if (navItem != _currentItem)
                {
                    _lview.Width = _splitView.CompactPaneLength;
                    await System.Threading.Tasks.Task.Delay(50);

                    _currentItem = navItem;
                    _content.Children.Clear();
                    _content.Children.Add(navItem.Control);
                    _container.Visibility = Visibility.Visible;
                    _content.Visibility = Visibility.Visible;
                    _lviewSub.Visibility = Visibility.Collapsed;
                }
                else
                {
                    _splitView.IsPaneOpen = false;
                    _currentItem = null;
                }
            }
            else
            {
                _currentItem = navItem;
                _content.Children.Clear();
                _content.Children.Add(navItem.Control);
                _container.Visibility = Visibility.Visible;
                _content.Visibility = Visibility.Visible;
                _lviewSub.Visibility = Visibility.Collapsed;
                OpenLeftPane();
            }
        }
 public void SelectItem(string id)
 {
     if (_isInitialized)
     {
         if (id != null)
         {
             int index    = 0;
             var selected = _lview.Items.Cast <NavigationItem>().Select(r => new { Index = index++, Item = r }).Where(r => r.Item.ID != null && r.Item.ID.Equals(id, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
             if (selected != null)
             {
                 _currentItem         = selected.Item;
                 _selectedIndex       = selected.Index;
                 _lview.SelectedIndex = selected.Index;
             }
         }
         else
         {
             _currentItem         = null;
             _selectedIndex       = -1;
             _lview.SelectedIndex = -1;
         }
     }
 }
Esempio n. 3
0
 public void SelectItem(string id)
 {
     if (_isInitialized)
     {
         if (id != null)
         {
             int index = 0;
             var selected = _lview.Items.Cast<NavigationItem>().Select(r => new { Index = index++, Item = r }).Where(r => r.Item.ID != null && r.Item.ID.Equals(id, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
             if (selected != null)
             {
                 _currentItem = selected.Item;
                 _selectedIndex = selected.Index;
                 _lview.SelectedIndex = selected.Index;
             }
         }
         else
         {
             _currentItem = null;
             _selectedIndex = -1;
             _lview.SelectedIndex = -1;
         }
     }
 }
Esempio n. 4
0
 private void InvokeClick(NavigationItem navItem)
 {
     _splitView.IsPaneOpen = false;
     _currentItem          = navItem;
     navItem.OnClick(navItem);
 }
Esempio n. 5
0
 private void InvokeClick(NavigationItem navItem)
 {
     _splitView.IsPaneOpen = false;
     _currentItem = navItem;
     navItem.OnClick(navItem);
 }
Esempio n. 6
0
 private void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (!_splitView.IsPaneOpen)
     {
         var navItem = _lview.SelectedItem as NavigationItem;
         if (navItem != null)
         {
             if (navItem.ClearSelection)
             {
                 _lview.SelectedItem = null;
                 _currentItem = null;
             }
         }
     }
 }