Exemplo n.º 1
0
        //押されたアイテムの処理
        private void NavView_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
        {
            if (args.IsSettingsSelected)
            {
                //ContentFrame.Navigate(typeof(SettingsPage));
            }
            else
            {
                NavigationViewItem item = args.SelectedItem as NavigationViewItem;

                switch (item.Tag.ToString())
                {
                case "home":
                    ContentFrame.Navigate(typeof(home));
                    NavView.Header = "ホーム";
                    break;

                case "signup":
                    ContentFrame.Navigate(typeof(signin));
                    NavView.Header = "サインアップ";

                    break;

                case "signin":
                    ContentFrame.Navigate(typeof(Signup));
                    NavView.Header = "サインイン";
                    break;

                case "signout":
                    ContentFrame.Navigate(typeof(Page));
                    NavView.Header = "サインアウト";
                    break;

                case "work":
                    ContentFrame.Navigate(typeof(BookmarkList));

                    //確認用
                    signin.Visibility  = Visibility.Collapsed;
                    signup.Visibility  = Visibility.Collapsed;
                    signout.Visibility = Visibility.Visible;

                    NavView.Header = "仕事";
                    break;

                case "music":
                    ContentFrame.Navigate(typeof(BookmarkList));
                    NavView.Header = "音楽";
                    break;

                case "enter":
                    ContentFrame.Navigate(typeof(BookmarkList));
                    NavView.Header = "芸能";
                    break;

                case "sport":
                    ContentFrame.Navigate(typeof(BookmarkList));
                    NavView.Header = "スポーツ";
                    break;

                case "fashion":
                    ContentFrame.Navigate(typeof(BookmarkList));
                    NavView.Header = "ファッション";
                    break;

                case "game":
                    ContentFrame.Navigate(typeof(BookmarkList));
                    NavView.Header = "ゲーム";
                    break;

                case "other":
                    ContentFrame.Navigate(typeof(BookmarkList));
                    NavView.Header = "その他";
                    break;
                }
            }
        }
Exemplo n.º 2
0
 public static bool GetIsStartPage(NavigationViewItem obj)
 {
     return((bool)obj.GetValue(IsStartPageProperty));
 }
Exemplo n.º 3
0
 public static string GetNavigateTo(NavigationViewItem item)
 {
     return((string)item.GetValue(NavigateToProperty));
 }
Exemplo n.º 4
0
        private bool IsMenuItemForPageType(NavigationViewItem menuItem, Type sourcePageType)
        {
            var pageKey = menuItem.GetValue(NavHelper.NavigateToProperty) as string;

            return(_pageService.GetPageType(pageKey) == sourcePageType);
        }
Exemplo n.º 5
0
 public static Type GetPageType(NavigationViewItem obj)
 {
     return((Type)obj.GetValue(PageTypeProperty));
 }
Exemplo n.º 6
0
        private bool IsMenuItemForPageType(NavigationViewItem menuItem, Type sourcePageType)
        {
            var pageType = menuItem.GetValue(NavHelper.NavigateToProperty) as Type;

            return(pageType == sourcePageType);
        }
Exemplo n.º 7
0
 public static bool GetRestricted(NavigationViewItem item)
 {
     return((bool)item.GetValue(RestrictedProperty));
 }
Exemplo n.º 8
0
        private void NavView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
        {
            if (args.IsSettingsInvoked)
            {
                contentFrame.Navigate(typeof(SettingsPage));
                return;
            }

            Type pageType = null;
            NavigationViewItem navViewItem = args.InvokedItemContainer as NavigationViewItem;

            if (navViewItem != null)
            {
                switch (navViewItem.Tag)
                {
                case "WelcomePage":
                    pageType = typeof(WelcomePage);
                    break;

                case "BasicInputPage":
                    pageType = typeof(BasicInputPage);
                    break;

                case "CollectionsPage":
                    pageType = typeof(CollectionsPage);
                    break;

                case "DateAndTimePage":
                    pageType = typeof(DateAndTimePage);
                    break;

                case "DialogsAndFlyoutsPage":
                    pageType = typeof(DialogsAndFlyoutsPage);
                    break;

                case "LayoutPage":
                    pageType = typeof(LayoutPage);
                    break;

                case "MediaPage":
                    pageType = typeof(MediaPage);
                    break;

                case "MenuToolbarPage":
                    pageType = typeof(MenuToolbarPage);
                    break;

                case "TextPage":
                    pageType = typeof(TextPage);
                    break;

                case "RevealPage":
                    pageType = typeof(RevealPage);
                    break;

                case "AnimationsPage":
                    pageType = typeof(AnimationsPage);
                    break;
                }
                if (pageType != null)
                {
                    contentFrame.Navigate(pageType);
                }
            }
        }
Exemplo n.º 9
0
        private void NavView_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
        {
            NavigationViewItem item = args.SelectedItem as NavigationViewItem;

            NavView_Navigate(item);
        }
 public static void SetPageParameter(NavigationViewItem element, object value)
 {
     element.SetValue(PageParameterProperty, value);
 }
 public static void SetPageType(NavigationViewItem element, Type value)
 {
     element.SetValue(PageTypeProperty, value);
 }
 public static Type GetPageType(NavigationViewItem element)
 {
     return((Type)element.GetValue(PageTypeProperty));
 }
 public static object GetPageParameter(NavigationViewItem element)
 {
     return((object)element.GetValue(PageParameterProperty));
 }
 //--------------------------------------------------------Constructor:----------------------------------------------------------------\\
 #region --Constructors--
 public MainPageNavigationPage(Type targetPage, NavigationViewItem navItem, string pageName)
 {
     TARGET_PAGE = targetPage;
     NAV_ITEM    = navItem;
     PAGE_NAME   = pageName;
 }
Exemplo n.º 15
0
        private string currentTag = ""; // Each page tab on the top is tagged with a word. The three are "media", "playlists" and "player". This keeps track of where we are.

        /// <summary>
        /// When one of the page tabs is clicked.
        /// </summary>
        /// <param name="args">Information about the click.</param>
        private void nvTabs_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
        {
            NavigationViewItem item = sender.MenuItems.OfType <NavigationViewItem>().First(x => (string)x.Content == (string)args.InvokedItem) as NavigationViewItem; // Find which item is clicked.

            navigate(item);                                                                                                                                           // Change page based on that clicked item.
        }
Exemplo n.º 16
0
        private void NavView_Navigate(NavigationViewItem item)
        {
            if (item != null)
            {
                switch (item.Tag)
                {
                case "today":
                    ContentFrame.Navigate(typeof(DailyReportPage));
                    NavView.Header = "Mai nap";
                    break;

                case "week":
                    ContentFrame.Navigate(typeof(WeeklyReportPage));
                    NavView.Header = "Heti jelenzés";
                    break;

                case "expired":
                    ContentFrame.Navigate(typeof(ExpiredTasksPage));
                    NavView.Header = "Lejárt feladatok";
                    break;


                case "Checklist":
                    ContentFrame.Navigate(typeof(SingleCategoryPage));
                    NavView.Header = item.Content;
                    if (ViewModel.Categories.FirstOrDefault(c => c.Name == item.Content.ToString()) != null)
                    {
                        ViewModel.SelectedCategory = ViewModel.Categories.FirstOrDefault(c => c.Name == item.Content.ToString());
                    }
                    break;

                case "MultiChecklist":
                    ContentFrame.Navigate(typeof(MultiCheckListPage));
                    NavView.Header = item.Content;
                    if (ViewModel.Categories.FirstOrDefault(c => c.Name == item.Content.ToString()) != null)
                    {
                        ViewModel.SelectedCategory = ViewModel.Categories.FirstOrDefault(c => c.Name == item.Content.ToString());
                    }
                    break;

                case "Kanban3":
                    ContentFrame.Navigate(typeof(KanbanPage));
                    NavView.Header = item.Content;
                    if (ViewModel.Categories.FirstOrDefault(c => c.Name == item.Content.ToString()) != null)
                    {
                        ViewModel.SelectedCategory = ViewModel.Categories.FirstOrDefault(c => c.Name == item.Content.ToString());
                    }
                    break;

                case "Kanban5":
                    ContentFrame.Navigate(typeof(KanbanExtendedPage));
                    NavView.Header = item.Content;
                    if (ViewModel.Categories.FirstOrDefault(c => c.Name == item.Content.ToString()) != null)
                    {
                        ViewModel.SelectedCategory = ViewModel.Categories.FirstOrDefault(c => c.Name == item.Content.ToString());
                    }
                    break;



                case "addnew":
                    ContentFrame.Navigate(typeof(NewCategoryPage));
                    NavView.Header = "Kategória hozzáadása";
                    break;

                default:
                    ContentFrame.Navigate(typeof(SettingsPage));
                    NavView.Header = "Beállítások";
                    break;
                }
            }
        }
Exemplo n.º 17
0
        private async Task NavView_Navigate(NavigationViewItem item)
        {
            try
            {
                UserExtensionHelper.PickupWhereYouLeft(item.Tag.ToString());
                switch (item.Tag)
                {
                case "LogIn":
                    await LoginUser();

                    break;

                case "LogOut":
                    AuthenticationHelper.SignOut();
                    login.Visibility           = Visibility.Visible;
                    logout.Visibility          = Visibility.Collapsed;
                    RecentFiles.Visibility     = Visibility.Collapsed;
                    UploadFile.Visibility      = Visibility.Collapsed;
                    DownloadFile.Visibility    = Visibility.Collapsed;
                    ContentFile.Visibility     = Visibility.Collapsed;
                    OutlookContacts.Visibility = Visibility.Collapsed;
                    ScheduleEvent.Visibility   = Visibility.Collapsed;
                    UserExtension.Visibility   = Visibility.Collapsed;
                    SaveAppData.Visibility     = Visibility.Collapsed;
                    Activity.Visibility        = Visibility.Collapsed;
                    break;

                case "RecentFiles":
                    ContentFrame.Navigate(typeof(RecentOneDriveFiles));
                    break;

                case "UploadFile":
                    ContentFrame.Navigate(typeof(UploadFileToOneDrive));
                    break;

                case "DownloadFile":
                    ContentFrame.Navigate(typeof(DownloadOneDriveFile));
                    break;

                case "ContentFile":
                    ContentFrame.Navigate(typeof(ContentFileOneDrive));
                    break;

                case "OutlookContacts":
                    ContentFrame.Navigate(typeof(OutlookContacts));
                    break;

                case "ScheduleEvent":
                    ContentFrame.Navigate(typeof(ScheduleEventOutlook));
                    break;

                case "UserExtension":
                    ContentFrame.Navigate(typeof(UserExtension));
                    break;

                case "SaveAppData":
                    ContentFrame.Navigate(typeof(SaveAppData));
                    break;

                case "Activity":
                    ContentFrame.Navigate(typeof(ActivityGraph));
                    break;
                }
            }
            catch (Exception ex)
            {
                NavView.Header = $"And error ocurred: {ex}";
            }
        }
Exemplo n.º 18
0
 public static Type GetPageType(NavigationViewItem obj)
 => (Type)obj.GetValue(PageTypeProperty);
 private void Frame_Navigated(object sender, NavigationEventArgs e)
 {
     Selected = _navigationView.MenuItems
                .OfType <NavigationViewItem>()
                .FirstOrDefault(menuItem => IsMenuItemForPageType(menuItem, e.SourcePageType));
 }
Exemplo n.º 20
0
        private void navView_Navigate(NavigationViewItem item)
        {
            //https://icons8.com/articles/unofficial-style-guide-to-windows10icons/
            timer.Stop();
            switch (item.Tag)
            {
            case "home":
                if (webComponent.getLocale() != "es")
                {
                    //ApplicationLanguages.PrimaryLanguageOverride = webComponent.getLocale();
                    //Frame.Navigate(this.GetType());
                    this.iHome.Content = "Inicio";
                }
                if (webComponent.getHome)
                {
                    goRoute("/home");
                }
                else
                {
                    this.webView.Navigate(new Uri("https://mobile.twitter.com/"));
                }
                break;

            case "explore":
                if (webComponent.getExplore)
                {
                    goRoute("/explore");
                }
                else
                {
                    this.webView.Navigate(new Uri("https://mobile.twitter.com/explore"));
                }
                break;

            case "profile":
                if (webComponent.getProfile)
                {
                    goRoute("/" + webComponent.getUsername());
                }
                else
                {
                    this.webView.Navigate(new Uri("https://mobile.twitter.com/" + webComponent.getUsername()));
                }
                break;

            case "notifications":
                if (webComponent.getNotifications)
                {
                    goRoute("/notifications");
                }
                else
                {
                    this.webView.Navigate(new Uri("https://mobile.twitter.com/notifications"));
                }
                break;

            case "messages":
                if (webComponent.getMessages)
                {
                    goRoute("/messages");
                }
                else
                {
                    this.webView.Navigate(new Uri("https://mobile.twitter.com/messages"));
                }
                break;

            case "lists":
            {
                this.webView.Navigate(new Uri("https://mobile.twitter.com/" + webComponent.getUsername() + "/lists"));
            }
            break;

            case "tweet":
                if (webComponent.getCompose)
                {
                    goRoute("/compose/tweet");
                }
                else
                {
                    this.webView.Navigate(new Uri("https://mobile.twitter.com/compose/tweet"));
                }
                break;
            }
        }
Exemplo n.º 21
0
 public static void SetRestricted(NavigationViewItem item, bool value)
 {
     item.SetValue(RestrictedProperty, value);
 }
Exemplo n.º 22
0
 private Type GetPageType(NavigationViewItem item)
 {
     return(item.Tag as Type);
 }
Exemplo n.º 23
0
 public static Type GetNavigateTo(NavigationViewItem item)
 {
     return((Type)item.GetValue(NavigateToProperty));
 }
Exemplo n.º 24
0
 public static void SetNavigateTo(NavigationViewItem item, Type value)
 {
     item?.SetValue(NavigateToProperty, value);
 }
Exemplo n.º 25
0
 public static void SetPageType(NavigationViewItem obj, Type value)
 {
     obj.SetValue(PageTypeProperty, value);
 }
 public NavigationViewItemAutomationPeer(NavigationViewItem owner) :
     base(owner)
 {
 }
Exemplo n.º 27
0
 public static void SetIsStartPage(NavigationViewItem obj, bool value)
 {
     obj.SetValue(IsStartPageProperty, value);
 }
Exemplo n.º 28
0
 public AppViewModel()
 {
     _selectedMenuItem = null;
 }
Exemplo n.º 29
0
 public static void SetNavigateTo(NavigationViewItem item, string value)
 {
     item.SetValue(NavigateToProperty, value);
 }
Exemplo n.º 30
0
 public static void SetNavigateTo(NavigationViewItem item, string value)
 {
     logger.Info("Set Navigation value: {value}", value);
     item.SetValue(NavigateToProperty, value);
 }