Recommended

Skip Navigation LinksHome / Search

Search

 
Results Per Page

Found 22 results for Nikolay Raychev.
Date between: <not defined> and <not defined>
Search in: News , Articles , Tips , Shows , Showcase , Books

Page 
Order by Publish Date   Ascending Title   Rating  

  • 5 comments  /  posted by  Nikolay Raychev  on  Apr 02, 2009 (more than a year ago)
    Silverlight 3 comes with two built in Pixel Shaders:

    We have the following image:



    We want to blur it:

    <Image Width="300"   
        Source="http://terraristic.net/photos/  
        Brachypelma_albiceps/Brachypelma_albiceps_1.jpg"> 
        <Image.Effect>
            <BlurEffect Radius="8"></BlurEffect>
        </Image.Effect>
    </Image> 

    We have the following result:



    Note the Radius parameter. The bigger the radius is, the more blurred the picture is.

    Now let's make a shadowed picture:

    <Image Width="300"   
        Source="http://terraristic.net/photos/  
        Brachypelma_albiceps/Brachypelma_albiceps_1.jpg"> 
        <Image.Effect>
            <DropShadowEffect BlurRadius="30" Color="Gray"
                Direction="-45" Opacity="0.5" ShadowDepth="20">
            </DropShadowEffect>
        </Image.Effect> 
    </Image> 

    The result:

     

    The DropShadow effect has several parameters:
    • BlurRadius - the bigger the radius is, the more blurred the shadow is.
    • Color - the shadow color.
    • Direction - an angle specifying the direction of the shadow. If you set it to zero the shadow will fall on the right side.
    • Opacity - the shadow opacity.
    • ShadowDepth - it specifies how far (deep) from the picture the shadow will appear.

    You can define your own Pixel Shaders using a special language called HLSL. But this is beyond the scope of this tip.



  • 1 comments  /  posted by  Nikolay Raychev  on  Apr 02, 2009 (more than a year ago)
    In Silverlight 3 you can make multiple selections in a ListBox. You just need to set the SelectionMode parameter:

    <ListBox Margin="5" x:Name="lbTasks"   
        ItemsSource="{Binding Tasks, ElementName=MainPageView}"   
        SelectionMode="Multiple">  
        <ListBox.ItemTemplate> 
            <DataTemplate> 
                <StackPanel Orientation="Horizontal" Margin="2">  
                    <TextBlock FontWeight="Bold" FontSize="13"   
                        Foreground="#ff006882" Text="{Binding Text}">  
                    </TextBlock> 
                </StackPanel> 
            </DataTemplate> 
        </ListBox.ItemTemplate> 
    </ListBox> 

    You have 3 options for the SelectionMode:
    • Single - you can select only one item.
    • Multiple - you can select multiple items by selecting one item, holding Ctrl or Shift key and pressing another item.
    • Extended - you can again select multiple items but the Shift key acts differently. With the help of the Shift key you can select items range by just pressing one item, holding Shift and pressing another one.
  • 9 comments  /  posted by  Nikolay Raychev  on  Mar 25, 2009 (more than a year ago)

    Introduction

    Animation Easing are built in animation functions in Silverlight 3. They include several commonly used animations effects.

    Overview

    I'll describe in details how you can use the BackEase animation. Imagine that you want to move an Ellipse from the top to the bottom of a Canvas. You just create a Storyboard with DoubleAnimation as follows:

    <UserControl x:Class="AnimationEasings.MainPage" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"   
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"   
        mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480" 
        Width="150" Height="450">  
        <UserControl.Resources> 
            <Storyboard x:Name="sbBackEaseIn">  
                <DoubleAnimation From="50" To="400" Duration="0:0:10" 
                    Storyboard.TargetName="circle" 
                    Storyboard.TargetProperty="(Canvas.Top)">  
                </DoubleAnimation> 
            </Storyboard> 
        </UserControl.Resources> 
        <Canvas x:Name="LayoutRoot" 
                Background="LightYellow">  
            <Ellipse x:Name="circle" Width="50" 
                Height="50" Canvas.Top="0" Canvas.Left="50">  
                <Ellipse.Fill> 
                    <ImageBrush x:Name="backgroundImageBrush" 
                        Stretch="UniformToFill">  
                        <ImageBrush.ImageSource> 
                            <BitmapImage x:Name="bmpBackground" 
    UriSource="http://www.silverlightshow.net/Storage/Users/nikolayraychev/sls_icon.jpg">  
                            </BitmapImage> 
                        </ImageBrush.ImageSource> 
                    </ImageBrush> 
                </Ellipse.Fill> 
            </Ellipse> 
        </Canvas> 
    </UserControl> 

    Code behind:

    public MainPage()  
    {  
        InitializeComponent();  
     
        this.sbBackEaseIn.Begin();  

    OK, but what if you want to make the ellipse move up for a while and after that move down.

  • 1 comments  /  posted by  Nikolay Raychev  on  Mar 25, 2009 (more than a year ago)
    It's very easy to style the caret in Silverlight 3. Look at that huge TextBox with a caret in the rainbow colors:



    You just need to set the CaretBrush property:

    <TextBox FontSize="50" Width="100" Height="80">  
        <TextBox.RenderTransform> 
            <ScaleTransform ScaleX="6" ScaleY="1"/>  
        </TextBox.RenderTransform> 
        <TextBox.CaretBrush>
            <LinearGradientBrush x:Name="backgroundLinearGradientBrush"
                MappingMode="RelativeToBoundingBox"
                    StartPoint="0,0" EndPoint="0,1">
                <LinearGradientBrush.GradientStops>
                    <GradientStop Color="Red" Offset="0" />
                    <GradientStop Color="Orange" Offset="0.167" />
                    <GradientStop Color="Yellow" Offset="0.333" />
                    <GradientStop Color="Green" Offset="0.5"/>
                    <GradientStop Color="Blue" Offset="0.667" />
                    <GradientStop Color="Indigo" Offset="0.833" />
                    <GradientStop Color="Violet" Offset="1" />
                </LinearGradientBrush.GradientStops>
            </LinearGradientBrush>
        </TextBox.CaretBrush> 
    </TextBox> 

    You can use any Silverlight supported Brush.

  • 38 comments  /  posted by  Nikolay Raychev  on  Mar 19, 2009 (more than a year ago)

    Introduction

    The SaveFileDialog is a new dialog control in Silverlight 3 which allows the user to save a file on the client machine.

    Overview

    To demonstrate the common use of the SaveFileDialog I’ll give an example:

    When you click on the button a dialog window appears which allows you to save a file.

  • 6 comments  /  posted by  Nikolay Raychev  on  Mar 19, 2009 (more than a year ago)

    In Silverlight 3 you are able to check if an internet connection is present. You can also detect network changes.

    See also:
    Silverlight 3 as a Desktop Application (Out-of-Browser Applications)

    Network availability checking:

    if (System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable())  
    {  
        this.InitTasks();  

    Network change detection:

    NetworkChange.NetworkAddressChanged += new 
    NetworkAddressChangedEventHandler(NetworkChangedCallback); 

     

    private void NetworkChangedCallback(object sender, EventArgs e)  
    {  
        if (System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable())  
        {  
            this.InitTasks();  
        }  

    Demo

    As an example I created the following demo:


    This is a simple tasks list. You can add or delete tasks. The tasks are saved on the server and the application is using WCF Service to connect to the server. Nothing special. But if you save the application for offline use you can use it even if you don't have internet connection. I'm using the isolated storage to keep copy of the data on the client and the application is working with the local copy when there is no connection. It synchronizes automatically whenever the connection comes back.

    Download Source 

     

  • 15 comments  /  posted by  Nikolay Raychev  on  Mar 18, 2009 (more than a year ago)

    Introduction

    A cool new feature in Silverlight 3 is the ability to run Silverlight applications out of the browser which resembles a desktop application. Only a few configuration steps are needed to enable your application to run offline.

    See also:
    Tip: Detecting Network Change in Silverllight 3 Application

    Overview

    To enable this feature you only need to open the AppManifest.xml file which can be found in the Properties folder and add
    some settings as follows:

    <Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" 
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
      EntryPointAssembly="TaskList" 
      EntryPointType="TaskList.App">  
      <Deployment.Parts> 
      </Deployment.Parts> 
      <Deployment.OutOfBrowserSettings> 
        <OutOfBrowserSettings  
          ShortName="Task List">  
          <OutOfBrowserSettings.WindowSettings> 
            <WindowSettings Title="Offline Task List" /> 
          </OutOfBrowserSettings.WindowSettings> 
          <OutOfBrowserSettings.Blurb> 
            Allows saving your tasks offline  
          </OutOfBrowserSettings.Blurb> 
        </OutOfBrowserSettings> 
      </Deployment.OutOfBrowserSettings> 
    </Deployment> 
     
  • 12 comments  /  posted by  Nikolay Raychev  on  Mar 18, 2009 (more than a year ago)

    Introduction

    A new feature in Silverlight 3 is the Perspective Transforms. With its help you can simulate rotating an object in 3D space. Note that this is not a real 3D, Silverlight does not support 3D yet.

    Overview

    Let's start with a little demo: 


    And let's describe the things step by step. You have an UIElement, in our situation an image. The X axis of the element is from left to right, the Y axis is going up and down and the Z axis is going in and out of the surface of the image.

    If we want to rotate the image on the X axis we are just setting the RotationX of the UIElement.Projection as follows:

     

    <Image x:Name="imgTarantula" Width="400" 
        HorizontalAlignment="Center" VerticalAlignment="Center"   
        Source="http://terraristic.net/photos/Acanthoscurria_geniculata/Acanthoscurria_geniculata_1.jpg">  
        <Image.Projection>
            <PlaneProjection RotationX="45"></PlaneProjection>
        </Image.Projection>
    </Image> 

    And we have the following result:

  • 25 comments  /  posted by  Nikolay Raychev  on  Nov 05, 2008 (more than a year ago)

    Introduction

    In this article my aim is to give a quick overview of the controls included in the Silverlight Toolkit - launched a week ago and to give an example for every control included in the toolkit. I've made a little research for each control and I will share my impressions with the community.

    Overview

    The following Silverlight controls are included in the toolkit:

    Components in the Stable Quality Band:

    • TreeView
    • DockPanel
    • WrapPanel
    • Label
    • HeaderedContentControl
    • HeaderedItemsControl

    Components in the Preview Quality Band

    • AutoCompleteBox
    • NumericUpDown
    • Viewbox
    • Expander
    • ImplicitStyleManager
    • Charting

    TreeView

    Let's start with the TreeView.

  • 6 comments  /  posted by  Nikolay Raychev  on  Sep 12, 2008 (more than a year ago)

    Introduction

    Note: this article is specific for Silverlight 2 Beta 2.

    What is Internationalization and localization?

    Localization and internationalization are the processes of making software capable to display content in different languages depending on the user preferences like described in Wikipedia.

    It's a common scenario in business applications to support multiple languages. Development environments often automate the process of internationalizing an application. For example Visual Studio can create local resources for an ASP.NET Page or User Control automatically and in the ASP.NET web application the proper localized strings can be loaded automatically depending on the user preferences without the need for the developer to implement all this functionality.

    What about Internationalization and localization in Silverlight?

    I spent a few hours in Internet looking for some resources which cover this topic. So I'll try to summarize the process of building an international Silverlight application and will give some examples.

    Using RESX files


Page 
Help us make SilverlightShow even better and win a free t-shirt. Whether you'd like to suggest a change in the structure, content organization, section layout or any other aspect of SilverlightShow appearance - we'd love to hear from you! Need a material (article, tutorial, or other) on a specific topic? Let us know and SilverlightShow content authors will work to have that prepared for you. (hide this)