private void OnRowViewChanged(RowView oldValue, RowView newValue) { if (oldValue != null) { oldValue.Refreshing -= OnRefreshing; } if (newValue != null) { newValue.Refreshing += OnRefreshing; UpdateState(); } }
public IEnumerable <CommandEntry> GetCommandEntries(RowView rowView) { if (Template.RowBindings.Any(x => x.IsEditable)) { yield return(Commands.ToggleEdit.Bind(ToggleEdit, CanToggleEdit)); yield return(Commands.BeginEdit.Bind(BeginEdit, CanBeginEdit, new KeyGesture(Key.F2))); yield return(Commands.CancelEdit.Bind(CancelEdit, CanCancelEdit, new KeyGesture(Key.Escape))); yield return(Commands.EndEdit.Bind(EndEdit, CanCancelEdit, new KeyGesture(Key.Enter))); } if (DataPresenter.IsRecursive) { yield return(Commands.Expand.Bind(ToggleExpandState, CanExpand, new KeyGesture(Key.OemPlus))); yield return(Commands.Collapse.Bind(ToggleExpandState, CanCollapse, new KeyGesture(Key.OemMinus))); } }
private void OnRowViewChanged(RowView oldValue, RowView newValue) { if (oldValue != null) { oldValue.SettingUp -= OnSettingUp; oldValue.Refreshing -= OnRefreshing; oldValue.CleaningUp -= OnCleaningUp; } if (newValue != null) { if (newValue.HasSetup) { OnSettingUp(); } newValue.SettingUp += OnSettingUp; newValue.Refreshing += OnRefreshing; newValue.CleaningUp += OnCleaningUp; } }
private void FillMissingRowViews(RowView currentRowView) { var currentRowIndex = currentRowView.RowPresenter.Index; var flowRepeatCount = ElementManager.FlowRepeatCount; var offset = currentRowIndex % flowRepeatCount; for (int i = 0; i < offset; i++) { AddRowView(i); } for (int i = offset + 1; i < flowRepeatCount; i++) { var success = AddRowView(i); if (!success) // Exceeded the total count of the rows { break; } } }
private RowView RemoveAllRowViewsExcept(RowPresenter row) { RowView result = null; var startIndex = BlockBindingsSplit; int flowRepeatCount = Elements.Count - BlockBindings.Count; for (int i = flowRepeatCount - 1; i >= 0; i--) { var index = startIndex + i; var rowView = (RowView)Elements[index]; if (rowView.RowPresenter == row) { result = rowView; } else { RemoveRowViewAt(index); } } Debug.Assert(result != null); return(result); }
private static IEnumerable <CommandEntry> GetCommandEntries(ICommandService commandService, RowView rowView) { return(commandService.GetCommandEntries(rowView)); }
private bool IsCurrent(RowView rowView) { return(rowView.RowPresenter != null && rowView.RowPresenter == DataPresenter.CurrentRow); }
private void OnLoaded(object sender, RoutedEventArgs e) { var rowPresenter = RowView.GetCurrent(this).RowPresenter; UpdateVisualStates(rowPresenter); }