Skip to content

Commit

Permalink
Renamed method, removed nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Leonenko committed Jul 4, 2024
1 parent ab28133 commit 64c078a
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Softeq.XToolkit.WhiteLabel.Droid/FragmentBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace Softeq.XToolkit.WhiteLabel.Droid
public class FragmentBase<TViewModel> : Fragment, IBindable
where TViewModel : ViewModelBase
{
private IList<IDisposable> _commandsSubscriptions = new List<IDisposable>();
private readonly List<IDisposable> _commandsSubscriptions = new();

public List<Binding> Bindings { get; } = new List<Binding>();

Expand Down Expand Up @@ -73,11 +73,8 @@ protected virtual void RestoreViewModelIfNeeded(Bundle? savedInstanceState)

protected virtual void DoAttachBindings()
{
var commands = SetCommands();
if (commands != null)
{
_commandsSubscriptions.AddRange(commands);
}
var commandsSubscriptions = SetCommandsWithDisposing();
_commandsSubscriptions.AddRange(commandsSubscriptions);
}

protected virtual void DoDetachBindings()
Expand All @@ -88,7 +85,7 @@ protected virtual void DoDetachBindings()
_commandsSubscriptions.Clear();
}

protected virtual IList<IDisposable>? SetCommands()
protected virtual IList<IDisposable> SetCommandsWithDisposing()
{
return new List<IDisposable>();
}
Expand Down

0 comments on commit 64c078a

Please sign in to comment.