Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make methods protected #97

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/BB84.Notifications/Commands/AsyncActionCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public sealed class AsyncActionCommand(Func<Task> execute, Func<bool>? canExecut

/// <inheritdoc/>
public bool CanExecute()
=> !_isExecuting && (canExecute?.Invoke() ?? true);
=> CanExecute(null);

/// <inheritdoc/>
public async Task ExecuteAsync()
Expand All @@ -42,7 +42,7 @@ public async Task ExecuteAsync()

/// <inheritdoc/>
public bool CanExecute(object? parameter)
=> CanExecute();
=> !_isExecuting && (canExecute?.Invoke() ?? true);

/// <inheritdoc/>
public void Execute(object? parameter)
Expand Down
9 changes: 5 additions & 4 deletions src/BB84.Notifications/NotifiableObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected void SetProperty<T>(ref T fieldValue, T newValue, [CallerMemberName] s
/// Raises the <see cref="PropertyChanged"/> event.
/// </summary>
/// <param name="propertyName">The name of the calling property.</param>
private void RaisePropertyChanged(string propertyName)
protected void RaisePropertyChanged(string propertyName)
=> PropertyChanged?.Invoke(this, new(propertyName));

/// <summary>
Expand All @@ -53,22 +53,23 @@ private void RaisePropertyChanged(string propertyName)
/// <typeparam name="T">The type to work with.</typeparam>
/// <param name="propertyName">The name of the calling property.</param>
/// <param name="value">The value of the calling property.</param>
private void RaisePropertyChanged<T>(string propertyName, T value)
protected void RaisePropertyChanged<T>(string propertyName, T value)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs<T>(propertyName, value));

/// <summary>
/// Raises the <see cref="PropertyChanging"/> event.
/// </summary>
/// <param name="propertyName">The name of the calling property.</param>
private void RaisePropertyChanging(string propertyName)
protected void RaisePropertyChanging(string propertyName)
=> PropertyChanging?.Invoke(this, new(propertyName));

/// <summary>
/// Raises the <see cref="PropertyChanging"/> event.
/// </summary>
/// <typeparam name="T">The type to work with.</typeparam>
/// <param name="propertyName">The name of the calling property.</param>
/// <param name="value">The value of the calling property.</param>
private void RaisePropertyChanging<T>(string propertyName, T value)
protected void RaisePropertyChanging<T>(string propertyName, T value)
=> PropertyChanging?.Invoke(this, new PropertyChangingEventArgs<T>(propertyName, value));

/// <summary>
Expand Down