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

New ProviderStateTrigger #107

Merged
merged 4 commits into from
Jun 8, 2021
Merged

New ProviderStateTrigger #107

merged 4 commits into from
Jun 8, 2021

Conversation

shweaver-MSFT
Copy link
Member

@shweaver-MSFT shweaver-MSFT commented Jun 1, 2021

Fixes #97 #9

PR Type

What kind of change does this PR introduce?

  • Feature

What is the new behavior?

Introducing a new XAML trigger, CommunityToolkit.Graph.Uwp.ProviderStateTrigger.

This trigger will allow developers to trigger VisualStates in XAML in response to any authentication state changes on the global provider.

Use the ProviderStateTrigger.ActiveState property to respond to changes in the global authentication provider.
The ActiveState property supports all ProviderStates values (Loading, SignedOut, SignedIn).

Example:

<VisualStateManager.VisualStateGroups xmlns:uwp="using:CommunityToolkit.Graph.Uwp">
    <VisualStateGroup>
        <VisualState>
            <VisualState.StateTriggers>
                <uwp:ProviderStateTrigger ActiveState="SignedIn" />
            </VisualState.StateTriggers>
            <VisualState.Setters>
                <Setter Target="ContentPivot.Visibility" Value="Visible" />
            </VisualState.Setters>
        </VisualState>
    </VisualStateGroup>
</VisualStateManager.VisualStateGroups>

<Grid x:Name="ContentPanel" Visibility="Collapsed">
    <TextBlock Text="This text is only visible when signed in." />
</Grid>

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • Sample in sample app has been added / updated (for bug fixes / features)
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes

Other information

@shweaver-MSFT shweaver-MSFT self-assigned this Jun 1, 2021
@ghost
Copy link

ghost commented Jun 1, 2021

Thanks shweaver-MSFT for opening a Pull Request! The reviewers will test the PR and highlight if there is any merge conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌

@ghost ghost assigned Kyaa-dost Jun 1, 2021
@shweaver-MSFT shweaver-MSFT merged commit 2a93f0a into dev/7.1.0 Jun 8, 2021
@shweaver-MSFT shweaver-MSFT deleted the shweaver/auth-trigger branch June 8, 2021 20:05
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