Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
255
Closing xamInfoBox via Binding
posted

I made incorrect assumption that setting IsOpen to true would show the box and setting the property to false would close it.  Is there a way to close the infoBox via binding?

Parents
No Data
Reply
  • 2848
    posted

    Hi,

    Your assumption was correct. This works fine:

    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
                <CheckBox
                    IsChecked="{Binding IsOpen, ElementName=infobox, Mode=TwoWay}"
                    Content="IsOpen"
                    VerticalAlignment="Top" />
                <TextBlock
                    x:Name="relative"
                    Text="RelativeToElement"
                    VerticalAlignment="Center"
                    HorizontalAlignment="Center" />

                <ig:XamInfoBox
                    x:Name="infobox"
                    IsClosedOnOutsideTap="False"
                    RelativeToElement="{Binding ElementName=relative}">
                    <TextBlock Text="InfoBox!" Padding="20" />
                </ig:XamInfoBox>

    </Grid>

    Can you provide us more details on how you are using it? If you are binding it to a ViewModel, that's properly implementing INotifyPropertyChanged and with a TwoWay binding, it should work..

    Thanks,

    Andres 

Children