Ejemplo n.º 1
0
        /// <summary>
        /// Erstellt die ApplicationBar.
        /// </summary>
        private void SetupAppBar()
        {
            taskApplicationBar                  = new ApplicationBar();
            friendsApplicationBar               = new ApplicationBar();
            taskApplicationBar.StateChanged    += ApplicationBar_StateChanged;
            friendsApplicationBar.StateChanged += ApplicationBar_StateChanged;

            taskApplicationBar.Opacity    = 0.5;
            friendsApplicationBar.Opacity = 0.5;

            friendsApplicationBar.Buttons.Add(ApplicationBarHelpers.CreateButton(Localization.Strings.ApplicationBarFindFriend, "/Icons/AppBar/feature.search.png",
                                                                                 this.NavigationService, "/SearchFriendsPage.xaml"));

            taskApplicationBar.Buttons.Add(ApplicationBarHelpers.CreateButton(Localization.Strings.ApplicationBarAdd, "/Icons/AppBar/add.png",
                                                                              this.NavigationService, "/TaskPage.xaml"));

            var item1 = ApplicationBarHelpers.CreateMenuItem(Localization.Strings.ApplicationBarAbout, this.NavigationService, "/AboutPage.xaml");
            var item2 = ApplicationBarHelpers.CreateMenuItem(Localization.Strings.ApplicationBarFinishedTasks, this.NavigationService, "/FinishedTaskPage.xaml");

            taskApplicationBar.MenuItems.Add(item2);
            taskApplicationBar.MenuItems.Add(item1);
            friendsApplicationBar.MenuItems.Add(item2);
            friendsApplicationBar.MenuItems.Add(item1);

            if (App.IsAdvertismentVisible)
            {
                var item3 = new ApplicationBarMenuItem(Localization.Strings.ApplicationBarRemoveAds);
                item3.Click += item3_Click;
                friendsApplicationBar.MenuItems.Add(item3);
                taskApplicationBar.MenuItems.Add(item3);
            }

            UpdateAppBar();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Erstellt die ApplicationBar.
        /// </summary>
        private void SetupAppBar()
        {
            this.ApplicationBar = new ApplicationBar();
            var button = new ApplicationBarIconButton(new Uri("/Icons/AppBar/delete.png", UriKind.Relative))
            {
                Text = Localization.Strings.ApplicationBarRemove
            };
            var viewModel = ((TaskPageViewModel)this.DataContext);

            if (!viewModel.IsDoneChangeable)
            {
                this.ApplicationBar.Buttons.Add(ApplicationBarHelpers.CreateButton("copy", "Icons/AppBar/add.png", this.NavigationService,
                                                                                   "/TaskPage.xaml?copy=" + viewModel.GetTaskId()));
            }

            button.Click += new EventHandler(button_Click);
            this.ApplicationBar.Buttons.Add(button);
        }