-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻ refactor(Breakpoint): differentiate the window size, breakpoint and…
… mobile change events
- Loading branch information
Showing
10 changed files
with
65 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
src/Masa.Blazor/Services/Breakpoint/BreakpointChangedEventArgs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
namespace Masa.Blazor; | ||
|
||
public class BreakpointChangedEventArgs : MobileChangedEventArgs | ||
public class BreakpointChangedEventArgs(Breakpoints breakpoint, bool breakpointChanged, bool mobile, bool mobileChanged) | ||
: MobileChangedEventArgs(mobile, mobileChanged) | ||
{ | ||
/// <summary> | ||
/// Indicates whether the value of Mobile property has changed. First time is always false. | ||
/// </summary> | ||
public bool MobileChanged { get; set; } | ||
} | ||
public Breakpoints Breakpoint { get; } = breakpoint; | ||
|
||
internal bool BreakpointChanged { get; } = breakpointChanged; | ||
} |
10 changes: 8 additions & 2 deletions
10
src/Masa.Blazor/Services/Breakpoint/MobileChangedEventArgs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
namespace Masa.Blazor; | ||
|
||
public class MobileChangedEventArgs : EventArgs | ||
public class MobileChangedEventArgs(bool mobile, bool mobileChanged) : EventArgs | ||
{ | ||
} | ||
public bool Mobile { get; } = mobile; | ||
|
||
/// <summary> | ||
/// Indicates whether the value of Mobile property has changed. First time is always false. | ||
/// </summary> | ||
internal bool MobileChanged { get; } = mobileChanged; | ||
} |
6 changes: 6 additions & 0 deletions
6
src/Masa.Blazor/Services/Breakpoint/WindowSizeChangedEventArgs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Masa.Blazor; | ||
|
||
public class WindowSizeChangedEventArgs(Breakpoints breakpoint, bool breakpointChanged, bool mobile, bool mobileChanged) | ||
: BreakpointChangedEventArgs(breakpoint, breakpointChanged, mobile, mobileChanged) | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters