Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
In Silverlight Business application . there is one image in mainpage.xaml

which is link with style.xaml like this :
XAML
    <contentcontrol style="{StaticResource LogoIcon}">;
</contentcontrol>


somewhere in style.xaml the icon property define like this :
XML
<Style x:Key="LogoIcon" TargetType="ContentControl">
       <Setter Property="Height" Value="24"/>
       <Setter Property="Width" Value="24"/>
       <Setter Property="Margin" Value="0,1,10,0"/>
       <Setter Property="Template">
           <Setter.Value>
               <ControlTemplate TargetType="ContentControl">
                   <Grid>
                       <Path UseLayoutRounding='False' Fill="{StaticResource HighLightColorBrush}" Stretch="Fill" Data="M8,0 C12.417931,2.8898596E-06 16,3.5814998 16,8 C16,12.417819 12.41803,16 8,16 C3.5816212,16 6.1398991E-06,12.417912 0,8 C1.5351338E-06,6.8954077 0.22386749,5.8431153 0.62867981,4.8860393 C0.65398115,4.82622 0.6799894,4.7667723 0.70669389,4.7077074 L0.73170543,4.6541386 L5.6357112,9.5581446 L3.7429986,11.450858 L3.7429986,11.493001 L11.669835,11.493001 L11.669835,3.5661643 L11.627691,3.5661643 L9.7349787,5.4588776 L4.8993444,0.62324351 L5.0666013,0.55490673 C5.5510159,0.36389247 6.0585575,0.21878535 6.5838675,0.12495131 C6.8465204,0.078035071 7.1136146,0.043936942 7.3844767,0.023327276 C7.5199089,0.013022465 7.6562829,0.0060896641 7.7935166,0.0026129775 C7.862133,0.00087448902 7.9309645,4.5157563E-08 8,0 z"/>
                   </Grid>
               </ControlTemplate>
           </Setter.Value>
       </Setter>
   </Style>



I wanted to change my icon for my project .
How i do this ? How to edit this style sheet in VS2010 which give me humen readable format for changing this XAML file.
Posted

1 solution

Hi,

The icon you are referring to in styles.xaml icons is a vector icon. To use a traditional bitmap icon you need to change you MainPage.Xaml as follow:

replace:
<ContentControl Style="{StaticResource LogoIcon}" DataContext="{Binding}" />

by:
<Image Height="32" Width="32" Source="Icons/check2-13.png"/>


Don't forget to add your icons to your project ;)

Is that answering your question?

Valery.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900