Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Binding to Content's property!

$
0
0

I have a control in which the content is loaded at run time.

It looks like this:

 <Style TargetType="{x:Type local:myControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:myControl">
                    <ContentControl
                                    Visibility="{TemplateBinding Visibility}"
                                    Focusable="False"
                                    Content="{TemplateBinding Content}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

My question is, if the Content's Visibility is collapsed, I want the whole thing to collapse. How do I bind the control to the content's visibility?


Please Mark as Answered if this answers your question Or UnMark as Answered if it did not. Happy to Help :)


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>