michielpost.nl

Silverlight Styling

10-10-2008

Silverlight has a powerful model to customize the look and feel of controls.

 

For example, you can alter the looks of a Button control by not supplying just a text for its content property, but an elipse with text in it. That way, the button will not be rendered as a default button, but use your own supplied style.

 

To be able to easily reuse your custom template, you can define a style in the App.xaml and manually set the style property on the button control. This works similar like CSS.

 

Example template to show the content of a button as an image (App.xaml):

<Style x:Key="ImageButtonStyle" TargetType="Button">

            <Setter Property="Template">

                <Setter.Value>

                    <ControlTemplate TargetType="Button">

                        <Grid>

                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center">

                                <ContentPresenter.Content>

                                    <Image Source="{TemplateBinding Content}"></Image>

                                </ContentPresenter.Content>

                            </ContentPresenter>

                        </Grid>

                    </ControlTemplate>

                </Setter.Value>

            </Setter>

        </Style>

 You can set the style on your button this way:
<Button Style="{StaticResource ImageButtonStyle}" Content="Img.png">

 

Comments


God, I feel like I sholud be takin notes! Great work 29-11-2015
God, I feel like I sholud be takin notes! Great work


That's a cunning answer to a chigaenllng question http://reoyyoutany.com [url=http://ezmsmjbgfxr.com]ezmsmjbgfxr[/url] [link=http://lnzcntpt.com]lnzcntpt[/link] 01-12-2015
That's a cunning answer to a chigaenllng question http://reoyyoutany.com [url=http://ezmsmjbgfxr.com]ezmsmjbgfxr[/url] [link=http://lnzcntpt.com]lnzcntpt[/link]


I love reading these articles because they're short but <a href="http://yulhoevpo.com">intormafive.</a> 03-12-2015
I love reading these articles because they're short but <a href="http://yulhoevpo.com">intormafive.</a>


It's a joy to find sooemne who can think like that http://gfupmrb.com [url=http://pdmqopz.com]pdmqopz[/url] [link=http://jassztly.com]jassztly[/link] 04-12-2015
It's a joy to find sooemne who can think like that http://gfupmrb.com [url=http://pdmqopz.com]pdmqopz[/url] [link=http://jassztly.com]jassztly[/link]


???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. https://helloworld.com?h=e12f10477c18cd576dedb0b393320e71& 19-11-2020
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. https://helloworld.com?h=e12f10477c18cd576dedb0b393320e71&


???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=e12f10477c18cd576dedb0b393320e71& 19-11-2020
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=e12f10477c18cd576dedb0b393320e71&


???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. https://helloworld.com?h=e12f10477c18cd576dedb0b393320e71& 19-11-2020
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. https://helloworld.com?h=e12f10477c18cd576dedb0b393320e71&


???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=e12f10477c18cd576dedb0b393320e71& 20-11-2020
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=e12f10477c18cd576dedb0b393320e71&


???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=e12f10477c18cd576dedb0b393320e71& 21-11-2020
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=e12f10477c18cd576dedb0b393320e71&


???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. https://helloworld.com?h=e12f10477c18cd576dedb0b393320e71& 04-12-2020
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. https://helloworld.com?h=e12f10477c18cd576dedb0b393320e71&


Buy legal anabolic steroids https://myfsk.org/community/account/buy-legal-anabolic-steroids/?h=e12f10477c18cd576dedb0b393320e71& 13-12-2020
Buy legal anabolic steroids https://myfsk.org/community/account/buy-legal-anabolic-steroids/?h=e12f10477c18cd576dedb0b393320e71&


<p><a href="https://f3gxp.page.link/Tbeh"><img src="https://i.ibb.co/rH6Ky7F/best-hookup-sites-fs.jpg"></a></p>?h=e12f10477c18cd576dedb0b393320e71& 20-12-2020
<p><a href="https://f3gxp.page.link/Tbeh"><img src="https://i.ibb.co/rH6Ky7F/best-hookup-sites-fs.jpg"></a></p>?h=e12f10477c18cd576dedb0b393320e71&


<p><a href="https://f3gxp.page.link/Tbeh"><img src="https://i.ibb.co/rH6Ky7F/best-hookup-sites-fs.jpg"></a></p>?h=e12f10477c18cd576dedb0b393320e71& 21-12-2020
<p><a href="https://f3gxp.page.link/Tbeh"><img src="https://i.ibb.co/rH6Ky7F/best-hookup-sites-fs.jpg"></a></p>?h=e12f10477c18cd576dedb0b393320e71&


JhpVM 10-01-2021
Drugs information sheet. Effects of Drug Abuse. <a href="https://prednisone4u.top">how to get cheap prednisone without insurance</a> in USA. Some trends of medicine. Read now. <a href=https://autokontrol.ae/about-us/#comment-4369>Everything news about meds.</a> <a href=https://aloeveraireland.ie/product/vitolize-for-men/#comment-69793>All news about medication.</a> <a href=https://dinhduongnet.com/san-pham/sua-appeton-weight-gain-vi-so-co-la-900g-sua-cho-nguoi-gay/#comment-67465>Some trends of drug.</a> 63a330_


New Comment

Name
E-mail (not published)
Comment
Enter the code shown: