Skip to content

Commit

Permalink
Fixed all public API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpeppers committed Apr 26, 2024
1 parent 300ad4e commit 86e9d49
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ public class CellTableViewCell : UITableViewCell, INativeElementView
WeakReference<Cell> _cell;
readonly WeakEventManager _weakEventManager = new();

public event Action<object, PropertyChangedEventArgs> PropertyChanged
// NOTE: internal callers can use InternalPropertyChanged
[Obsolete("To be removed in a future release.")]
public Action<object, PropertyChangedEventArgs> PropertyChanged;

internal event Action<object, PropertyChangedEventArgs> InternalPropertyChanged
{
add => _weakEventManager.AddEventHandler(value);
remove => _weakEventManager.RemoveEventHandler(value);
Expand Down Expand Up @@ -56,7 +60,7 @@ public Cell Cell

public Element Element => Cell;

public void HandlePropertyChanged(object sender, PropertyChangedEventArgs e) => _weakEventManager.HandleEvent(sender, e, nameof(PropertyChanged));
public void HandlePropertyChanged(object sender, PropertyChangedEventArgs e) => _weakEventManager.HandleEvent(sender, e, nameof(InternalPropertyChanged));

internal static UITableViewCell GetPlatformCell(UITableView tableView, Cell cell, bool recycleCells = false, string templateId = "")
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ public override UITableViewCell GetCell(Cell item, UITableViewCell reusableCell,
tvc = new EntryCellTableViewCell(item.GetType().FullName);
else
{
tvc.PropertyChanged -= HandlePropertyChanged;
tvc.InternalPropertyChanged -= HandlePropertyChanged;
tvc.TextFieldTextChanged -= OnTextFieldTextChanged;
tvc.KeyboardDoneButtonPressed -= OnKeyBoardDoneButtonPressed;
}

SetRealCell(item, tvc);

tvc.Cell = item;
tvc.PropertyChanged += HandlePropertyChanged;
tvc.InternalPropertyChanged += HandlePropertyChanged;
tvc.TextFieldTextChanged += OnTextFieldTextChanged;
tvc.KeyboardDoneButtonPressed += OnKeyBoardDoneButtonPressed;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public override UITableViewCell GetCell(Cell item, UITableViewCell reusableCell,
else
{
uiSwitch = tvc.AccessoryView as UISwitch;
tvc.PropertyChanged -= HandlePropertyChanged;
tvc.InternalPropertyChanged -= HandlePropertyChanged;
}

SetRealCell(item, tvc);
Expand All @@ -45,7 +45,7 @@ public override UITableViewCell GetCell(Cell item, UITableViewCell reusableCell,
_defaultOnColor = UISwitch.Appearance.OnTintColor;

tvc.Cell = item;
tvc.PropertyChanged += HandlePropertyChanged;
tvc.InternalPropertyChanged += HandlePropertyChanged;
tvc.AccessoryView = uiSwitch;
#pragma warning disable CA1416, CA1422 // TODO: 'UITableViewCell.TextLabel' is unsupported on: 'ios' 14.0 and later
tvc.TextLabel.Text = boolCell.Text;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ public override UITableViewCell GetCell(Cell item, UITableViewCell reusableCell,
if (!(reusableCell is CellTableViewCell tvc))
tvc = new CellTableViewCell(UITableViewCellStyle.Subtitle, item.GetType().FullName);
else
tvc.PropertyChanged -= HandleCellPropertyChanged;
tvc.InternalPropertyChanged -= HandleCellPropertyChanged;

SetRealCell(item, tvc);

tvc.Cell = textCell;
tvc.PropertyChanged += HandleCellPropertyChanged;
tvc.InternalPropertyChanged += HandleCellPropertyChanged;

#pragma warning disable CA1416, CA1422 // TODO: 'UITableViewCell.TextLabel', DetailTextLabel is unsupported on: 'ios' 14.0 and later
tvc.TextLabel.Text = textCell.Text;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@
~Microsoft.Maui.Controls.Handlers.Compatibility.CellTableViewCell.CellTableViewCell(UIKit.UITableViewCellStyle style, string key) -> void
~Microsoft.Maui.Controls.Handlers.Compatibility.CellTableViewCell.Element.get -> Microsoft.Maui.Controls.Element
~Microsoft.Maui.Controls.Handlers.Compatibility.CellTableViewCell.HandlePropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) -> void
Microsoft.Maui.Controls.Handlers.Compatibility.CellTableViewCell.PropertyChanged -> System.Action<object, System.ComponentModel.PropertyChangedEventArgs>
~Microsoft.Maui.Controls.Handlers.Compatibility.CellTableViewCell.PropertyChanged -> System.Action<object, System.ComponentModel.PropertyChangedEventArgs>
~Microsoft.Maui.Controls.Handlers.Compatibility.EntryCellRenderer.EntryCellTableViewCell.EntryCellTableViewCell(string cellName) -> void
~Microsoft.Maui.Controls.Handlers.Compatibility.EntryCellRenderer.EntryCellTableViewCell.TextField.get -> UIKit.UITextField
~Microsoft.Maui.Controls.Handlers.Compatibility.NavigationRenderer.Element.get -> Microsoft.Maui.Controls.VisualElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@
~Microsoft.Maui.Controls.Handlers.Compatibility.CellTableViewCell.CellTableViewCell(UIKit.UITableViewCellStyle style, string key) -> void
~Microsoft.Maui.Controls.Handlers.Compatibility.CellTableViewCell.Element.get -> Microsoft.Maui.Controls.Element
~Microsoft.Maui.Controls.Handlers.Compatibility.CellTableViewCell.HandlePropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) -> void
Microsoft.Maui.Controls.Handlers.Compatibility.CellTableViewCell.PropertyChanged -> System.Action<object, System.ComponentModel.PropertyChangedEventArgs>
~Microsoft.Maui.Controls.Handlers.Compatibility.CellTableViewCell.PropertyChanged -> System.Action<object, System.ComponentModel.PropertyChangedEventArgs>
~Microsoft.Maui.Controls.Handlers.Compatibility.EntryCellRenderer.EntryCellTableViewCell.EntryCellTableViewCell(string cellName) -> void
~Microsoft.Maui.Controls.Handlers.Compatibility.EntryCellRenderer.EntryCellTableViewCell.TextField.get -> UIKit.UITextField
~Microsoft.Maui.Controls.Handlers.Compatibility.NavigationRenderer.Element.get -> Microsoft.Maui.Controls.VisualElement
Expand Down

0 comments on commit 86e9d49

Please sign in to comment.