Skip to content

Change SettingsCard Description based on contained ToggleSwitch state #687

Closed Answered by Slion
Slion asked this question in Q&A
Discussion options

You must be logged in to vote

Here is my solution:

<c:SettingsCard x:Uid="SettingsCardExcludeFromPeeking">
    <c:SettingsCard.Description>
        <StackPanel Orientation="Vertical">
            <TextBlock x:Uid="TextBlockHideWhenPeeking" Visibility="{x:Bind Settings.ExcludeFromPeek, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter=True}" />
            <TextBlock x:Uid="TextBlockShowWhenPeeking" Visibility="{x:Bind Settings.ExcludeFromPeek, Mode=OneWay}" />
        </StackPanel>
    </c:SettingsCard.Description>
    <ToggleSwitch IsOn="{x:Bind Settings.ExcludeFromPeek, Mode=TwoWay}" OnContent="" OffContent="" />
</c:SettingsCard>

Though converter don't work from window XAML, you …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Slion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant