protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); string id = string.Empty; if (!NavigationContext.QueryString.TryGetValue("id", out id)) { id = "self"; } string s; if (NavigationContext.QueryString.TryGetValue("showHome", out s)) { if (s == "true" || s == "True") { var ab = ThemeManager.CreateApplicationBar(); AppBarHelper.AddButton(ab, "home", OnAppBarItemClick, "/Images/AB/appbar.home.png"); ApplicationBar = ab; } } DataContext = DataManager.Current.Load <Model.User>(id); }
private void UpdateAppBar() { if (_doneBar == null) { _doneBar = ThemeManager.CreateApplicationBar(); _markDoneBar = new Microsoft.Phone.Shell.ApplicationBar(); AppBarHelper.AddButton(_markDoneBar, "mark done", OnAppBarItemClick, AppBarIcon.OK); AppBarHelper.AddButton(_doneBar, "undo this", OnAppBarItemClick, AppBarIcon.Cancel); AppBarHelper.AddButton(_doneBar, "save", OnAppBarItemClick, AppBarIcon.Save); AppBarHelper.AddButton(_markDoneBar, "save", OnAppBarItemClick, AppBarIcon.Save); // punted from v3.0! //AppBarHelper.AddButton(_doneBar, "share", OnAppBarItemClick, "tbd"); //AppBarHelper.AddButton(_markDoneBar, "share", OnAppBarItemClick, "tbd"); AppBarHelper.AddButton(_doneBar, "refresh", OnAppBarItemClick, AppBarIcon.Refresh); AppBarHelper.AddButton(_markDoneBar, "refresh", OnAppBarItemClick, AppBarIcon.Refresh); } if (Item != null) { // was _list before... ApplicationBar = Item.IsDone ? _doneBar : _markDoneBar; } else { ApplicationBar = null; } }
private void SetupAppBar() { ApplicationBar = ThemeManager.CreateApplicationBar(); ApplicationBar.Opacity = .65; AppBarHelper.AddButton((ApplicationBar)ApplicationBar, "me", OnAppBarItemClick, "/Images/AB/map.center.png"); ApplicationBar.IsVisible = true; }
private void AppBars() { _bar = ThemeManager.CreateApplicationBar(); var btn1 = AppBarHelper.AddButton( _bar, "refresh", OnAppBarItemClick, AppBarIcon.Refresh); }
private void UpdateAppBar() { if (ApplicationBar == null) { var ab = ThemeManager.CreateApplicationBar(); // AppBarHelper.AddButton(ab, "ok", OnAppBarItemClick, AppBarIcon.OK); AppBarHelper.AddButton(ab, "cancel", OnAppBarItemClick, AppBarIcon.Cancel); ApplicationBar = ab; } }
private void CreateAppBar() { ApplicationBar = _appBar = ThemeManager.CreateApplicationBar(); _refreshButton = AppBarHelper.AddButton(_appBar, "refresh", OnAppBarItemClick, "/Images/AB/appbar.sync.rest.png"); _refreshButton.IsEnabled = false; // TODO: get refresh working. // TODO: stop button. }
private void UpdateAppBar() { if (_appBar == null) { _appBar = ThemeManager.CreateApplicationBar(); _save = AppBarHelper.AddButton(_appBar, "save", OnAppBarItemClick, AppBarIcon.Save); ApplicationBar = _appBar; } ApplicationBar = _appBar; }
private void InitAppBars() { _bar = new Microsoft.Phone.Shell.ApplicationBar(); AppBarHelper.AddButton(_bar, "report code issue", OnAppBarClick); if (_isPinned != null) { AppBarHelper.AddButton(_bar, _isPinned.Value == true ? "unpin" : "pin to start", OnAppBarClick, _isPinned.Value == true ? AppBarIcon.Unpin : AppBarIcon.Pin); } ApplicationBar = _bar; }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); _friendsBar = ThemeManager.CreateApplicationBar(); AppBarHelper.AddButton(_friendsBar, "add friends", OnAppBarItemClick, "/Images/AB/addpeople.png"); ApplicationBar = _friendsBar; string id = string.Empty; if (!NavigationContext.QueryString.TryGetValue("id", out id)) { id = "self"; } bool isSelf = false; string selfValue = null; if (NavigationContext.QueryString.TryGetValue("self", out selfValue)) { if (selfValue == "1") { isSelf = true; } } if (!isSelf) { _pivot.Items.Remove(_userRequests); } string req = string.Empty; if (isSelf && NavigationContext.QueryString.TryGetValue("requests", out req)) { if (!string.IsNullOrEmpty(req)) { // go to the requests page when possible! _pivot.SelectedIndex = 1; } } var user = DataManager.Current.Load <Model.User>(id); DataContext = user; }
private void UpdateAppBar() { if (_appBar == null) { _appBar = ThemeManager.CreateApplicationBar(); _save = AppBarHelper.AddButton(_appBar, "save", OnAppBarItemClick, AppBarIcon.Save); AppBarHelper.AddButton(_appBar, "create new", OnAppBarItemClick, AppBarIcon.Add); AppBarHelper.AddButton(_appBar, "refresh", OnAppBarItemClick, AppBarIcon.Refresh); ApplicationBar = _appBar; } if (_lists != null) { ApplicationBar = _appBar; } _save.IsEnabled = _checkedItemCount > 0; }
private void SetupAppBar() { ApplicationBar = new ApplicationBar(); ApplicationBar.Opacity = .65; _modeItem = new ApplicationBarMenuItem(); _modeItem.Click += _sat_Click; _modeItem.Text = _isSatelliteViewOn ? "road view" : "satellite view"; ApplicationBar.MenuItems.Add(_modeItem); AppBarHelper.AddButton((ApplicationBar)ApplicationBar, "me", OnAppBarItemClick, "/Images/AB/map.center.png"); //AppBarHelper.AddButton((ApplicationBar)ApplicationBar, "directions", OnAppBarItemClick, "/Images/AB/map.directions.png"); if (Environment.OSVersion.Version.Minor >= 1) { // Mango. AppBarHelper.AddButton((ApplicationBar)ApplicationBar, "open in maps app", OnAppBarItemClick); } ApplicationBar.IsVisible = true; }
private void UpdateAppBar() { if (_followingAppBar == null) { _followingAppBar = ThemeManager.CreateApplicationBar(); //_unfollow = AppBarHelper.AddButton(_followingAppBar, "unfollow", OnAppBarItemClick, "tbd"); // punted from v3.0! //AppBarHelper.AddButton(_followingAppBar, "share", OnAppBarItemClick, "tbd"); AppBarHelper.AddButton(_followingAppBar, "refresh", OnAppBarItemClick, AppBarIcon.Refresh); } if (_notFollowingAppBar == null) { _notFollowingAppBar = ThemeManager.CreateApplicationBar(); //_follow = AppBarHelper.AddButton(_notFollowingAppBar, "follow", OnAppBarItemClick, "tbd"); // punted from v3.0! //AppBarHelper.AddButton(_notFollowingAppBar, "share", OnAppBarItemClick, "tbd"); AppBarHelper.AddButton(_notFollowingAppBar, "refresh", OnAppBarItemClick, AppBarIcon.Refresh); } var dc = DataContext as Model.List; if (dc != null && dc.IsLoadComplete) { // Only restore if it has already loaded. ApplicationBar = dc.IsFollowing ? _followingAppBar : _notFollowingAppBar; } else { ApplicationBar = null; } }