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

Porting Triggers #13

Merged
merged 19 commits into from
Apr 7, 2023
Merged

Porting Triggers #13

merged 19 commits into from
Apr 7, 2023

Conversation

niels9001
Copy link
Collaborator

@niels9001 niels9001 commented Mar 27, 2023

Current triggers are not fully supported:

FullScreenModeStateTrigger: Uno / WASDK
UserInteractionMode: Uno / WASDK

@michael-hawker
Copy link
Member

Fixed XAML Styling, hopefully will see build info now

@michael-hawker
Copy link
Member

Seeing issues with DispatcherQueue extension?

"D:\a\Windows\Windows\components\Triggers\src\CommunityToolkit.WinUI.Controls.Triggers.csproj" (default target) (5:58) ->
  D:\a\Windows\Windows\components\Triggers\src\NetworkConnectionStateTrigger.cs(24,28): error CS0176: Member 'DispatcherQueue.GetForCurrentThread()' cannot be accessed with an instance reference; qualify it with a type name instead [D:\a\Windows\Windows\components\Triggers\src\CommunityToolkit.WinUI.Controls.Triggers.csproj]
  D:\a\Windows\Windows\components\Triggers\src\NetworkConnectionStateTrigger.cs(39,31): error CS1061: 'DispatcherQueue' does not contain a definition for 'EnqueueAsync' and no accessible extension method 'EnqueueAsync' accepting a first argument of type 'DispatcherQueue' could be found (are you missing a using directive or an assembly reference?) [D:\a\Windows\Windows\components\Triggers\src\CommunityToolkit.WinUI.Controls.Triggers.csproj]
  D:\a\Windows\Windows\components\Triggers\src\NetworkConnectionStateTrigger.cs(42,29): error CS1061: 'DispatcherQueue' does not contain a definition for 'EnqueueAsync' and no accessible extension method 'EnqueueAsync' accepting a first argument of type 'DispatcherQueue' could be found (are you missing a using directive or an assembly reference?) [D:\a\Windows\Windows\components\Triggers\src\CommunityToolkit.WinUI.Controls.Triggers.csproj]

Does this just depend on #12 now too?

@michael-hawker
Copy link
Member

Hopefully the last remaining issues:

"D:\a\Windows\Windows\components\Triggers\src\CommunityToolkit.WinUI.Controls.Triggers.csproj" (default target) (5:63) ->
  D:\a\Windows\Windows\components\Triggers\src\IsEqualStateTrigger.cs(97,22): error CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). For example, the pattern '_' is not covered. [D:\a\Windows\Windows\components\Triggers\src\CommunityToolkit.WinUI.Controls.Triggers.csproj]
  D:\a\Windows\Windows\components\Triggers\src\UserInteractionModeStateTrigger.cs(73,38): error Uno0001: Windows.UI.ViewManagement.UIViewSettings.UserInteractionMode is not implemented in Uno [D:\a\Windows\Windows\components\Triggers\src\CommunityToolkit.WinUI.Controls.Triggers.csproj]
  D:\a\Windows\Windows\components\Triggers\src\UserInteractionModeStateTrigger.cs(73,38): error Uno0001: Windows.UI.ViewManagement.UIViewSettings.GetForCurrentView() is not implemented in Uno [D:\a\Windows\Windows\components\Triggers\src\CommunityToolkit.WinUI.Controls.Triggers.csproj]
  D:\a\Windows\Windows\components\Triggers\src\UserHandPreferenceStateTrigger.cs(17,26): error Uno0001: Windows.UI.ViewManagement.UISettings.HandPreference is not implemented in Uno [D:\a\Windows\Windows\components\Triggers\src\CommunityToolkit.WinUI.Controls.Triggers.csproj]
  D:\a\Windows\Windows\components\Triggers\src\FullScreenModeStateTrigger.cs(43,115): error Uno0001: Windows.UI.ViewManagement.ApplicationView.IsFullScreenMode is not implemented in Uno [D:\a\Windows\Windows\components\Triggers\src\CommunityToolkit.WinUI.Controls.Triggers.csproj]
  D:\a\Windows\Windows\components\Triggers\src\FullScreenModeStateTrigger.cs(58,40): error Uno0001: Windows.UI.ViewManagement.ApplicationView.IsFullScreenMode is not implemented in Uno [D:\a\Windows\Windows\components\Triggers\src\CommunityToolkit.WinUI.Controls.Triggers.csproj]

Wonder if we want the ApplicationView based trigger, does that serve a purpose in WinUI 3 world atm? Full screen stuff is handled differently, right?

Leads into the CommunityToolkit/Tooling-Windows-Submodule#33 discussion on what we should do with Uno0001 errors as well and either not raise them as errors (except locally on the WASM head) maybe? Let them flow through so we can identify things folks want to use and point to Uno issues later vs. having to ensure everything works or code it out (as if code it out and Uno releases a build which it works for, then it's still not usable vs. the other way around).

@Arlodotexe I think this just means we need to set Uno0001 as NoWarn (except for the single-component WASM head), right?

@michael-hawker
Copy link
Member

Ugh meant to rebase... anyway, @niels9001 the NoWarn was added to main so this should hopefully just build now?

@michael-hawker
Copy link
Member

Couple of warnings as errors:

"D:\a\Windows\Windows\components\Triggers\src\CommunityToolkit.WinUI.Controls.Triggers.csproj" (default target) (7:75) ->
  D:\a\Windows\Windows\components\Triggers\src\IsEqualStateTrigger.cs(97,22): error CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). For example, the pattern '_' is not covered. [D:\a\Windows\Windows\components\Triggers\src\CommunityToolkit.WinUI.Controls.Triggers.csproj]
  D:\a\Windows\Windows\components\Triggers\src\UserHandPreferenceStateTrigger.cs(13,35): error CS0649: Field 'UserHandPreferenceStateTrigger.handPreference' is never assigned to, and will always have its default value [D:\a\Windows\Windows\components\Triggers\src\CommunityToolkit.WinUI.Controls.Triggers.csproj]

@niels9001 niels9001 marked this pull request as ready for review April 6, 2023 20:00
@michael-hawker
Copy link
Member

@niels9001 think we're good, just want to rename the test file?

Copy link
Member

@michael-hawker michael-hawker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the go around, did a final pass and noticed an extra indentation to a file, and realized we could tidy up another small thing.

components/Triggers/src/NetworkConnectionStateTrigger.cs Outdated Show resolved Hide resolved
components/Triggers/samples/Triggers.md Outdated Show resolved Hide resolved
@niels9001 niels9001 added this pull request to the merge queue Apr 7, 2023
Merged via the queue into main with commit d09e7f6 Apr 7, 2023
@delete-merged-branch delete-merged-branch bot deleted the niels9001/triggers branch April 7, 2023 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants