private void ActiveListerGotItems(object sender, EventArgs e) { BaseItems = Items = Workspace.ActiveLister.Items; FocusInput(); OnGotItems(this, EventArgs.Empty); ItemsView.MoveCurrentTo(Workspace.ActiveLister.ItemsView.CurrentItem); }
//------------------------------------------------------------------------------------ /// <summary> /// CreateItem command /// </summary> //------------------------------------------------------------------------------------ public override void CreateItem() { // Make sure we've got a selected item in the view, so we'll have a // default mentor item (if the user doesn't already have an item selected). if (ItemsView.CurrentItem == null) { ItemsView.MoveCurrentToFirst(); } BacklogItem mentorBacklogItem = ItemsView.CurrentItem as BacklogItem; BacklogItem newItem = HostItemStore.Instance.CreateStoreItem <BacklogItem>(ItemTypeID.BacklogItem); newItem.BeginSaveImmediate(); newItem.ShipCycle = Constants.OfficeCurrentShipCycle; newItem.BusinessRank = 9999; newItem.Title = "New Backlog Item"; // The mentor item is the item the user had selected when electing to create a new item. // We'll base the new item's basic properties on that of the mentor item. if (mentorBacklogItem != null) { newItem.ShipCycle = mentorBacklogItem.ShipCycle; newItem.ParentPillarItem = mentorBacklogItem.ParentPillarItem; newItem.ParentTrainItem = mentorBacklogItem.ParentTrainItem; } newItem.SaveImmediate(); ItemsView.MoveCurrentTo(newItem); }
public override void Open() { BaseItems = Workspace.ActiveLister.Items.ToList(); Workspace.ActiveLister.GotItems += ActiveListerGotItems; SetHeaderIconByKey("appbar_folder"); ItemsView.MoveCurrentTo(Workspace.ActiveLister.ItemsView.CurrentItem); base.Open(); }
public void SetCurrent(PickCollectionDataModel item) { ItemsView.MoveCurrentTo(item); if (item != null) { SelectedItems.AddLocked(item); } else { SelectedItems.ClearLocked(); } }
private void Attach() { this.eventAggregator.GetEvent <AudioSelectedEvent>().Subscribe(item => { CurrentItem = item; ItemsView.MoveCurrentTo(item); SwitchTimeProgressCommand.RaiseCanExecuteChanged(); MoveNextCommand.RaiseCanExecuteChanged(); MovePrevCommand.RaiseCanExecuteChanged(); }); this.commandsProxy.MoveNextCommand.RegisterCommand(this.MoveNextCommand); this.commandsProxy.MovePrevCommand.RegisterCommand(this.MovePrevCommand); this.playerService.Finished += PlayFinished; this.playerService.PositionChanged += PositionChanged; this.playerService.LoadedChanged += LoadedChanged; this.playerService.VolumeChanged += VolumeChanged; ShowVolume(this.playerService.Volume); }
public void Find(object value) { var stringValue = value.ToString(); if (string.IsNullOrWhiteSpace(stringValue)) { return; } var property = (PropertyAdapter <TViewModel>)propertiesView.CurrentItem; var item = ItemsView.OfType <TViewModel>().FirstOrDefault(i => property.GetValue(i).ToString().StartsWith(stringValue, StringComparison.CurrentCultureIgnoreCase)); if (item != null) { ItemsView.MoveCurrentTo(item); } }
/// <summary> /// Goes to item. /// </summary> /// <param name="id">The identifier.</param> private void GoToItem(Guid id) { try { var item = Items.Single(s => s.Id == id); ItemsView.MoveCurrentTo(item); } catch (Exception ex) { _dialogService.ShowExceptionDialog( new ExceptionNotification { Operation = "Go To Stem", Exception = ex }); } }
public async Task RefreshAsync() { try { IsLoading = true; CheckAndCloseAudioToken(); await ClearItems(); await this.audioService.LoadListAsync(AddItemToList, this.audioToken.Token); IsLoading = false; if (ItemsView.Contains(this.currentItem)) { ItemsView.MoveCurrentTo(this.currentItem); } } catch (OperationCanceledException) { Debug.WriteLine("Catch OperationCanceledException in AudioController"); } }