none
silverlight background

    Question

  •  Hi Experts,

             I want to do shaded background ,same like silverlight.net website.Whether it is possible in xaml or not ?

              If possible , please give me some example......Thanks in advance

     


    Wednesday, November 04, 2009 4:40 AM

All replies

  • I am using a Gradient effect.  This is in my MainPage.XAML:

    <Grid.Background>

    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">

    <GradientStop Color="LightGray" Offset="0"/>

    <GradientStop Color="White" Offset="1"/>

    </LinearGradientBrush>

    </Grid.Background>

    Wednesday, November 04, 2009 4:51 AM
  • I dont want ordinary background........I want below like background in xaml
    Wednesday, November 04, 2009 5:07 AM
  • <!-- Logo Icon Style -->

    <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>

    <Image Margin="2.475,-1.815,2.475,8" Source="/YourImage.png" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto">

    <Image.RenderTransform>

    <TransformGroup>

    <ScaleTransform/>

    <SkewTransform/>

    <RotateTransform />

    <TranslateTransform/>

    </TransformGroup>

    </Image.RenderTransform>

    </Image>

    </Grid>

    </ControlTemplate>

    </Setter.Value>

    </Setter>

    </Style>

    In your XAML, add a ContentControl:

    <ContentControl Style="{StaticResource LogoIcon}" Height="705.987" Margin="630,0,10,-734.345" Width="276.15" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" VerticalAlignment="Bottom">

    <ContentControl.RenderTransform>

    <TransformGroup>

    <ScaleTransform/>

    <SkewTransform/>

    <RotateTransform />

    <TranslateTransform/>

    </TransformGroup>

    </ContentControl.RenderTransform>

    </ContentControl>

    Obviously the Height, widths etc. will need to change.  I originally used Expression Blend 3 to load this image.

    Wednesday, November 04, 2009 5:11 AM
  • sorry ardman, 

         I want that kind of shades in pure xaml , i dont want image as background.Plz any  samples or examples  .....

    Wednesday, November 04, 2009 5:32 AM
  • Hi,

    Just a thought. I usually make use of Microsoft Expression Design Tool for design purpose and then export that design in Silverlight XAML. Check if this helps you or not.

    http://msdn.microsoft.com/en-us/library/cc375001(Expression.30).aspx

    Thanks,

    Pravin

    "Please mark as answered, if this answers your question"

    Wednesday, November 04, 2009 6:03 AM