locked
Create Apple Leopard text RRS feed

  • Question

  • I don't no if it's helpfull for anyone but I find a way to create the beautifull Apple Leopard Text in Silverlight. I'am a designer and wanted to achieve this look.

    Example
    1. Create a button
    2. Right click on the button and choose Edit Template > Edit a Copy, this way you enter the App.xaml (your stylesheet)
    3. Search in the code for the ContentPresenter. This looks like below ...

    <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />

    4. Change this code into below. At the end of this code snippet I changed /> to >, and closed it with </ContentPresenter>. This way I can put code inside the ContentPresenter.

    <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"></ContentPresenter> 

    5. To add the Leopard Text Style you put to following code into the CodePresenter

    <ContentPresenter.Effect>
             <DropShadowEffect Color="White" BlurRadius="0" Direction="-80" ShadowDepth="1" />
    </ContentPresenter.Effect>

    6. This piece of code puts a shadow beneath the original text. DONE!

    i hope this is usefull to anyone. this code works with silverlight 3, I don't know if its compatible wit 2 or 1.

    with kind regard,

    Barry

     

     

    Thursday, January 7, 2010 4:54 AM

Answers

  •  I agree that on the standard silverlight buttons it's hard to see. But when you customize the button in the style you want it can be pretty addition.

     


     

    Friday, January 8, 2010 2:53 AM

All replies

  • Hmm,

    I tried it, it took me a while to see there really is a difference to the normal buttons.


    If anybody wants to know how this looks. See below image: left is the leopard style, right is the standard style.
    Thursday, January 7, 2010 2:42 PM
  •  I agree that on the standard silverlight buttons it's hard to see. But when you customize the button in the style you want it can be pretty addition.

     


     

    Friday, January 8, 2010 2:53 AM
  • Note that drop shadows can be very expensive and you would want to use caution when implementing it and make sure it doesn't negatively impact performance.

    Monday, January 11, 2010 7:02 AM