Skip to content

Commit

Permalink
Merge pull request #351 from AvaloniaCommunity/fixWarnings
Browse files Browse the repository at this point in the history
Fix compilation warnings
  • Loading branch information
SKProCH authored Feb 25, 2024
2 parents 01b5e41 + 3e1bbe4 commit 95dc7e9
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions Material.Ripple/RippleEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected override void OnSizeChanged(SizeChangedEventArgs e) {
}
}

private void PointerPressedHandler(object sender, PointerPressedEventArgs e) {
private void PointerPressedHandler(object? sender, PointerPressedEventArgs e) {
var (x, y) = e.GetPosition(this);
if (_container is null || x < 0 || x > Bounds.Width || y < 0 || y > Bounds.Height) {
return;
Expand All @@ -83,17 +83,17 @@ private void PointerPressedHandler(object sender, PointerPressedEventArgs e) {
}
}

private void LostFocusHandler(object sender, RoutedEventArgs e) {
private void LostFocusHandler(object? sender, RoutedEventArgs e) {
_isCancelled = true;
RemoveLastRipple();
}

private void PointerReleasedHandler(object sender, PointerReleasedEventArgs e) {
private void PointerReleasedHandler(object? sender, PointerReleasedEventArgs e) {
_isCancelled = true;
RemoveLastRipple();
}

private void PointerCaptureLostHandler(object sender, PointerCaptureLostEventArgs e) {
private void PointerCaptureLostHandler(object? sender, PointerCaptureLostEventArgs e) {
_isCancelled = true;
RemoveLastRipple();
}
Expand Down
4 changes: 2 additions & 2 deletions Material.Styles/Commands/SnackbarCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public SnackbarCommand(SnackbarHost host, SnackbarModel model) {
_model = model;
}

public bool CanExecute(object parameter) => true;
public bool CanExecute(object? parameter) => true;

public void Execute(object parameter) {
public void Execute(object? parameter) {
try {
_model.Button?.Action?.Invoke();
_host.SnackbarModels.Remove(_model);
Expand Down
8 changes: 4 additions & 4 deletions Material.Styles/Controls/Clock.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ protected override void OnApplyTemplate(TemplateAppliedEventArgs e) {
UpdateSelectedTime();
}

private void CircleClockPickerOnPointerReleased(object sender, PointerReleasedEventArgs e) {
var circleClockPicker = (CircleClockPicker)sender;
private void CircleClockPickerOnPointerReleased(object? sender, PointerReleasedEventArgs e) {
var circleClockPicker = (CircleClockPicker)sender!;
if (circleClockPicker.Value is null) {
return;
}
Expand All @@ -136,8 +136,8 @@ private void CircleClockPickerOnPointerReleased(object sender, PointerReleasedEv
?.Focus();
}

private void InputBoxOnGotFocusHandler(object sender, GotFocusEventArgs e) {
_selectedInputBox = (NumericUpDown)sender;
private void InputBoxOnGotFocusHandler(object? sender, GotFocusEventArgs e) {
_selectedInputBox = (NumericUpDown)sender!;
OnSelectedInputBoxChange();
}

Expand Down
2 changes: 1 addition & 1 deletion Material.Styles/Controls/MaterialInternalIcon.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private void UpdateData() {
Data = Geometry.Parse(data);

else
Data = null;
throw new InvalidOperationException($"There is no path data for icon kind {Kind}");
}
}
}
2 changes: 1 addition & 1 deletion Material.Styles/Controls/NavigationDrawer.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ private void UpdateContentMargin()
ContentMargin = new Thickness(left, 0, right, 0);
}

private void PART_Scrim_Pressed(object sender, RoutedEventArgs e)
private void PART_Scrim_Pressed(object? sender, RoutedEventArgs e)
{
LeftDrawerOpened = false;
RightDrawerOpened = false;
Expand Down
2 changes: 1 addition & 1 deletion Material.Styles/Controls/Scroller.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ private void CalculatedPropertiesChanged() {
}
}

private void OnLayoutUpdated(object sender, EventArgs e) => RaiseScrollChanged();
private void OnLayoutUpdated(object? sender, EventArgs e) => RaiseScrollChanged();

private void RaiseScrollChanged() {
var extentDelta = new Vector(Extent.Width - _oldExtent.Width, Extent.Height - _oldExtent.Height);
Expand Down
2 changes: 1 addition & 1 deletion Material.Styles/Controls/SideSheet.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e
base.OnDetachedFromVisualTree(e);
}

private void PART_Scrim_Pressed(object sender, RoutedEventArgs e)
private void PART_Scrim_Pressed(object? sender, RoutedEventArgs e)
{
SideSheetOpened = false;
}
Expand Down
2 changes: 1 addition & 1 deletion Material.Styles/Controls/SnackbarHost.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public static void Post(SnackbarModel model, string? targetHost,

// If duration is TimeSpan.Zero, dont expire it.
if (model.Duration != TimeSpan.Zero) {
void OnExpired(object sender, ElapsedEventArgs args) {
void OnExpired(object? sender, ElapsedEventArgs args) {
if (sender is not Timer timer)
return;

Expand Down
4 changes: 2 additions & 2 deletions Material.Styles/Themes/MaterialTheme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void Dispose() {
_themeUpdateDisposable?.Dispose();
}

private void OnOwnerChanged(object sender, EventArgs e) {
private void OnOwnerChanged(object? sender, EventArgs e) {
RegisterActualThemeObservable();
}

Expand Down Expand Up @@ -119,7 +119,7 @@ private void RegisterActualThemeObservable() {
SetupActualTheme();
}

private void HostOnActualThemeVariantChanged(object sender, EventArgs e) {
private void HostOnActualThemeVariantChanged(object? sender, EventArgs e) {
SetupActualTheme();
}

Expand Down

0 comments on commit 95dc7e9

Please sign in to comment.