Click here to Skip to main content
15,886,578 members
Articles / Desktop Programming / WPF

Extending Castle DynamicProxy

Rate me:
Please Sign up or sign in to vote.
4.00/5 (1 vote)
8 May 2010CPOL7 min read 25.7K   183   12  
Shows how to extend the proxy generated by this framework by using Reflection.Emit.
<UserControl 
    x:Class="WPFUI.View.ProductsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:acb="clr-namespace:AttachedCommandBehavior;assembly=AttachedCommandBehavior"
    Style="{StaticResource ViewStyle}">
    <Grid>        
        <Grid.RowDefinitions>
            <RowDefinition Height="30"/>
            <RowDefinition/>
            <RowDefinition Height="30"/>
        </Grid.RowDefinitions>
        <Button 
            Grid.Row="0"
            HorizontalAlignment="Left"
            Content="Load Data"
            Command="{Binding Call}"
            CommandParameter="LoadData"
            />
        <ListView
            Grid.Row="1"
            Style="{StaticResource EntityCollectionViewListStyle}"
            ItemsSource="{Binding EntityCollection}"  
            >
            <ListView.View>
                <GridView>
                    <GridViewColumn
                        Header="Name"
                        DisplayMemberBinding="{Binding ProductName}"
                        Width="120"/>
                    <GridViewColumn
                        Header="Price"
                        DisplayMemberBinding="{Binding ProductPrice}"
                        Width="70"/>
                    <GridViewColumn
                        Header="Photo"
                        Width="50">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Image 
                                    Source="{Binding ProductPhotography}" 
                                    Width="30" 
                                    Height="35"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>            
        </ListView>
        <Button 
            Grid.Row="2"
            HorizontalAlignment="Left"
            Content="Remove Selected"
            Command="{Binding Call}"
            CommandParameter="RemoveSelected"
            IsEnabled="{Binding CanRemove}"
            />
    </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)


Written By
Brazil Brazil
Software developer specialized in the .NET framework

Comments and Discussions