Silverlight 3 – Exercicio 1 com novos recursos (Projection)

2009
06.10

Warning: fopen(C:\Inetpub\vhosts\facunte.com.br\httpdocs\wp-content\plugins\devformatter\geshi\geshi\xml.php) [function.fopen]: failed to open stream: No such file or directory in D:\Domains\facunte.com.br\wwwroot\wp-content\plugins\devformatter\devgeshi.php on line 103

Warning: fopen(C:\Inetpub\vhosts\facunte.com.br\httpdocs\wp-content\plugins\devformatter\geshi\geshi\xml.php) [function.fopen]: failed to open stream: No such file or directory in D:\Domains\facunte.com.br\wwwroot\wp-content\plugins\devformatter\devgeshi.php on line 103

Salve meus nobres,

A Microsoft está malhando muito na evolução do Silverlight e já dá pra sentir forte melhoria na versão 3.

Estou com a versão 3.0 Beta e a diversão não tem hora pra acabar.

Neste pequeno exemplo, criaremos um formulário em perspectiva, utilizando o novo recurso Projection.


sl11


  • No Vs 2008, aponte para New Project > Visual C# > Silverlight > Silverlight Application.
  • Em seguida informe o nome da aplicação (silverlight_ex6)
  • Na tela seguinte do Wizard, selecione a opção Add a new Web to theâ?¦ e informe o nome silverlight_ex6Web.
  • Apontando na sua área de código (XAML) insira o código que segue :

001
002
<UserControl x:Class="sl_exemplo_7.MainPage"
003
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
004
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
005
    Width="600" Height="450">
006
    <Grid x:Name="LayoutRoot">
007
 
008
 
009
        <Border CornerRadius="10"
010
            BorderBrush="Navy"
011
            BorderThickness="6"
012
            Background="AliceBlue"
013
            HorizontalAlignment="Center"
014
            VerticalAlignment="Center">
015
 
016
            <Grid Margin="30">
017
 
018
                <Grid.ColumnDefinitions>
019
                    <ColumnDefinition Width="100" />
020
                    <ColumnDefinition Width="200" />
021
                </Grid.ColumnDefinitions>
022
                <Grid.RowDefinitions>                    
023
                    <RowDefinition Height="30" />
024
                    <RowDefinition Height="30" />
025
                    <RowDefinition Height="30" />
026
                    <RowDefinition Height="30" />
027
                    <RowDefinition Height="30" />
028
 
029
                </Grid.RowDefinitions>
030
 
031
                <!-- Campos -->
032
 
033
                <TextBlock Grid.Row="0" 
034
                        Grid.Column="0"                           
035
                        Text="Nome"
036
                        VerticalAlignment="Center"
037
                 />
038
 
039
                <TextBox Grid.Row="0"
040
                         Grid.Column="1"
041
                         Text="Facunte"
042
                         Height="25"                         
043
                />
044
 
045
 
046
                <TextBlock Grid.Row="1"
047
                       Grid.Column="0"                       
048
                       Text="email" 
049
                       VerticalAlignment="Center"
050
                 />
051
 
052
                <TextBox Grid.Row="1"
053
                         Grid.Column="1"
054
                         Text="emerson@facunte.com.br"
055
                         Height="25"                         
056
                />
057
 
058
                <TextBlock Grid.Row="2"
059
                       Grid.Column="0"                
060
                       Text="Twitter"
061
                       VerticalAlignment="Center"                                                   
062
                 />
063
 
064
                <TextBox Grid.Row="2"
065
                         Grid.Column="1"
066
                         Text="facunte"
067
                         Height="25"                         
068
                />
069
 
070
 
071
 
072
                <TextBlock Grid.Row="3"
073
                       Grid.Column="0"                
074
                       Text="Facebook"
075
                       VerticalAlignment="Center"
076
                           />
077
 
078
                <TextBox Grid.Row="3"
079
                         Grid.Column="1"
080
                         Text="facunte"
081
                         Height="25"                         
082
                />
083
 
084
 
085
                <Button Grid.Row="4"
086
                    Grid.Column="1"
087
                    Margin="2"                   
088
                        Width="120"
089
 
090
                    Content="Confirma" />
091
 
092
            </Grid>
093
 
094
            <Border.Projection>
095
                <PlaneProjection x:Name="Projection"
096
                             CenterOfRotationX="1"
097
                             CenterOfRotationY="1"
098
                             CenterOfRotationZ="1" 
099
                                 RotationX="30"
100
                                 RotationY="30"
101
                                 RotationZ="-30"
102
 
103
                                 />
104
            </Border.Projection>
105
 
106
        </Border>
107
 
108
 
109
    </Grid>
110
</UserControl>
111

Tags: , , , , , , ,

One Response to “Silverlight 3 – Exercicio 1 com novos recursos (Projection)”

  1. 1000ton says:

    que maneiro isso, Silverlight 3.0 show de bola

Your Reply