Example #1
0
 private void InitializeSessions(bool show, IList <ISessionService> items)
 {
     for (int i = 0; i < NavigationViewItems.Count; i++)
     {
         if (NavigationViewItems[i] is ISessionService)
         {
             NavigationViewItems.RemoveAt(i);
             i--;
         }
         else if (NavigationViewItems[i] is Controls.NavigationViewItem viewItem && string.Equals(viewItem.Name, NavigationAdd))
         {
             NavigationViewItems.RemoveAt(i);
             i--;
         }
Example #2
0
        private void InitializeUser(MainViewModel viewModel)
        {
            for (int i = 0; i < NavigationViewItems.Count; i++)
            {
                if (NavigationViewItems[i] is MainViewModel)
                {
                    NavigationViewItems.RemoveAt(i);
                    i--;
                }
            }

            if (viewModel != null)
            {
                NavigationViewItems.Insert(0, viewModel);
            }
        }