Skip to content

Commit 339c8d7

Browse files
committed
remove redundant methods
add spacing add nullablility for nullable cells/rows fix issue sending cell into edit mode
1 parent 08f9477 commit 339c8d7

File tree

6 files changed

+14
-24
lines changed

6 files changed

+14
-24
lines changed

src/EventArgs/TableViewCellDoubleTappedEventArgs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ public TableViewCellDoubleTappedEventArgs(TableViewCellSlot slot, TableViewCell
3333
/// <summary>
3434
/// Gets the item associated with the cell.
3535
/// </summary>
36-
public object Item { get; }
36+
public object? Item { get; }
3737
}

src/EventArgs/TableViewRowDoubleTappedEventArgs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ public TableViewRowDoubleTappedEventArgs(int index, TableViewRow row, object ite
3333
/// <summary>
3434
/// Gets the item associated with the row.
3535
/// </summary>
36-
public object Item { get; }
36+
public object? Item { get; }
3737
}

src/TableView.Events.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,11 @@ protected virtual void OnRowDoubleTapped(TableViewRowDoubleTappedEventArgs args)
115115
/// Called before the <see cref="CellDoubleTapped"/> event occurs.
116116
/// </summary>
117117
/// <param name="args">The event data.</param>
118-
protected virtual void OnCellDoubleTapped(TableViewCellDoubleTappedEventArgs args)
118+
protected internal virtual void OnCellDoubleTapped(TableViewCellDoubleTappedEventArgs args)
119119
{
120120
CellDoubleTapped?.Invoke(this, args);
121121
}
122+
122123
/// <summary>
123124
/// Event triggered when the cell context flyout is opening.
124125
/// </summary>

src/TableView.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,22 +1452,6 @@ internal bool ShowCellContext(TableViewCell cell, Point position)
14521452
return false;
14531453
}
14541454

1455-
/// <summary>
1456-
/// Raises the RowDoubleTapped event.
1457-
/// </summary>
1458-
internal void RaiseRowDoubleTappedEvent(TableViewRow row)
1459-
{
1460-
var eventArgs = new TableViewRowDoubleTappedEventArgs(row.Index, row, row.Content);
1461-
OnRowDoubleTapped(eventArgs);
1462-
}
1463-
/// <summary>
1464-
/// Raises the CellDoubleTapped event.
1465-
/// </summary>
1466-
internal void RaiseCellDoubleTappedEvent(TableViewCell cell)
1467-
{
1468-
var eventArgs = new TableViewCellDoubleTappedEventArgs(cell.Slot, cell, cell.Row?.Content!);
1469-
OnCellDoubleTapped(eventArgs);
1470-
}
14711455
/// <summary>
14721456
/// Sets the state of the corner button.
14731457
/// </summary>

src/TableViewCell.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,13 @@ private double GetHorizontalGridlineHeight()
311311
/// <inheritdoc/>
312312
protected override async void OnDoubleTapped(DoubleTappedRoutedEventArgs e)
313313
{
314-
base.OnDoubleTapped(e);
314+
var eventArgs = new TableViewCellDoubleTappedEventArgs(Slot, this, Row?.Content);
315+
TableView?.OnCellDoubleTapped(eventArgs);
316+
e.Handled = eventArgs.Handled;
317+
318+
if (e.Handled) return;
315319

316-
TableView?.RaiseCellDoubleTappedEvent(this);
320+
base.OnDoubleTapped(e);
317321

318322
if (!IsReadOnly && TableView is not null && !TableView.IsEditing && !Column?.UseSingleElement is true)
319323
{

src/TableViewRow.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,11 @@ protected override void OnTapped(TappedRoutedEventArgs e)
191191
/// <inheritdoc/>
192192
protected override void OnDoubleTapped(DoubleTappedRoutedEventArgs e)
193193
{
194-
base.OnDoubleTapped(e);
194+
var eventArgs = new TableViewRowDoubleTappedEventArgs(Index, this, Content);
195+
TableView?.OnRowDoubleTapped(eventArgs);
196+
e.Handled = eventArgs.Handled;
195197

196-
TableView?.RaiseRowDoubleTappedEvent(this);
197-
e.Handled = true;
198+
base.OnDoubleTapped(e);
198199
}
199200

200201
/// <inheritdoc/>

0 commit comments

Comments
 (0)