Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version
Go to top

A Silverlight Introduction for Line-of-Business Applications

, 30 Aug 2009
An introduction on Silverlight for developers of administrative applications. The article starts by explaining the basics of WPF and then delves deeper in the business-oriented aspects.
silverlightlob_src.zip
CarSelector
CarSelector.csproj.user
Img
exit16.png
open16.png
Properties
Service References
CarService
CarSelector.CarService.Car.datasource
CarSelector.CarService.SimpleCar.datasource
CarService.disco
CarService.wsdl
configuration.svcinfo
configuration91.svcinfo
Reference.svcmap
ServiceReferences.ClientConfig
Themes
CarSelector.Web
App_Data
CarSelector.Web.csproj.user
CarService.svc
ClientBin
CarSelector.xap
Media
DBDataClasses.dbml
DBDataClasses.dbml.layout
Properties
Settings.settings
<UserControl x:Class="CarSelector.DetailPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:CarSelector"
    MinWidth="400" MinHeight="400" Padding="3">
    <UserControl.Resources>
        <Style x:Key="tbStyle" TargetType="TextBlock">
            <Setter Property="Margin" Value="3"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="HorizontalAlignment" Value="Right"/>
        </Style>
        <local:CurrencyValueConverter x:Key="CurrencyConverter"/>
    </UserControl.Resources>
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="30"/>
        </Grid.ColumnDefinitions>
        
        <Button Name="exitButton" Grid.Row="0" Grid.Column="2" ToolTipService.ToolTip="Terug naar lijst" Width="24" Height="24" Click="Button_Click">
            <Image Source="Img/exit16.png" Stretch="None"/>
        </Button>
        <TextBlock Style="{StaticResource tbStyle}" Grid.Row="1" Grid.Column="0">Merk:</TextBlock>
        <TextBox Margin="3" Text="{Binding Make, Mode=TwoWay}" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"/>
        <TextBlock Style="{StaticResource tbStyle}" Grid.Row="2" Grid.Column="0">Model:</TextBlock>
        <TextBox Margin="3" Text="{Binding Model, Mode=TwoWay}" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2"/>
        <TextBlock Style="{StaticResource tbStyle}" Grid.Row="3" Grid.Column="0">Type:</TextBlock>
        <TextBox Margin="3" Text="{Binding Type, Mode=TwoWay}" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2"/>
        <TextBlock Style="{StaticResource tbStyle}" Grid.Row="4" Grid.Column="0">Deuren:</TextBlock>
        <TextBox Margin="3" Width="75" HorizontalAlignment="Left" Text="{Binding Doors, Mode=TwoWay}" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2"/>
        <TextBlock Style="{StaticResource tbStyle}" Grid.Row="5" Grid.Column="0">Versnellingen:</TextBlock>
        <TextBox Margin="3" Width="75" HorizontalAlignment="Left" Text="{Binding Gears, Mode=TwoWay}" Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2"/>
        <TextBlock Style="{StaticResource tbStyle}" Grid.Row="6" Grid.Column="0">CO2:</TextBlock>
        <TextBox Margin="3" Width="75" HorizontalAlignment="Left" Text="{Binding CO2, Mode=TwoWay}" Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="2"/>
        <TextBlock Style="{StaticResource tbStyle}" Grid.Row="7" Grid.Column="0">Gewicht:</TextBlock>
        <TextBox Margin="3" Width="75" HorizontalAlignment="Left" Text="{Binding Weight, Mode=TwoWay}" Grid.Row="7" Grid.Column="1" Grid.ColumnSpan="2"/>
        <TextBlock Style="{StaticResource tbStyle}" Grid.Row="8" Grid.Column="0">Prijs:</TextBlock>
        <TextBox Margin="3" Width="120" HorizontalAlignment="Left" Text="{Binding Price, Mode=TwoWay, Converter={StaticResource CurrencyConverter}}" Grid.Row="8" Grid.Column="1" Grid.ColumnSpan="2"/>
        
        <Border BorderBrush="Black" BorderThickness="2" Margin="3" Grid.Row="9" Grid.Column="1" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
                <Image Name="pictureBox" Source="{Binding Picture}" Stretch="UniformToFill"/>    
            </ScrollViewer>
        </Border>
        
        <Button Grid.Row="10" Grid.Column="1" Width="75" Height="24" Click="Button_Click_1">
            <TextBlock>Opslaan</TextBlock></Button>
    </Grid>
</UserControl>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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

Share

About the Author

Xavier Spileers
CEO TRI-S bvba, Cogenius bvba
Belgium Belgium
I'm working since 1999 in an IT environment: started developing in PROGRESS 4GL, then VB6 and am working since 2003 with C#. I'm currently transitioning to HTML5, CSS3 and JavaScript for the front-end development.
I started my own company (TRI-S) in 2007 and co-founded another one (Cogenius) in 2012.
Besides being a Microsoft Certified Professional Developer (MCPD) I'm also a Microsoft Certified Trainer (MCT) and am teaching .NET and JavaScript courses.
Follow on   Google+

| Advertise | Privacy | Mobile
Web01 | 2.8.140926.1 | Last Updated 30 Aug 2009
Article Copyright 2009 by Xavier Spileers
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid