Skip to content

Commit

Permalink
feat: make methods protected
Browse files Browse the repository at this point in the history
closes #96
  • Loading branch information
BoBoBaSs84 committed May 20, 2024
1 parent a8edc48 commit 1b5c674
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
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

0 comments on commit 1b5c674

Please sign in to comment.