Click here to Skip to main content
12,294,775 members (62,497 online)
Click here to Skip to main content

Stats

55.7K views
2K downloads
96 bookmarked
Posted

Visual Expression Builder for Dynamic Linq

, 2 Feb 2012 CPOL
Let your users create their own Linq filters with this MVVM WPF tool you can include in your application
.svn
all-wcprops
dir-prop-base
entries
prop-base
ClassDiagram.png.svn-base
ScreenShot.png.svn-base
props
text-base
ClassDiagram.png.svn-base
ClassDiagram1.cd.svn-base
DoNotFilterOnAttribute.cs.svn-base
DynamicLinqExpressionBuilder.csproj.svn-base
DynamicLinqExpressionBuilder.sln.svn-base
DynamicLinqUserControl.xaml.cs.svn-base
DynamicLinqUserControl.xaml.svn-base
ExpressionList.cs.svn-base
ScreenShot.png.svn-base
tmp
prop-base
props
text-base
bin
Debug
DynamicLinqExpressionBuilder.dll
ClassDiagram.png
ClassDiagram1.cd
Properties
.svn
all-wcprops
entries
prop-base
props
text-base
AssemblyInfo.cs.svn-base
tmp
prop-base
props
text-base
ScreenShot.png
<UserControl x:Class="ChabadOnCampus.DynamicLinq.DynamicLinqUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:sys="clr-namespace:System;assembly=mscorlib"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="403"
             >
        <ListView ItemsSource="{Binding}" >
            <ListView.CommandBindings>
                <CommandBinding Command="Delete" CanExecute="CommandBinding_CanExecute" Executed="CommandBinding_Executed" />
            </ListView.CommandBindings>
            <ListView.ItemTemplate>
                <DataTemplate>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="50" />
                            <ColumnDefinition Width="100" />
                            <ColumnDefinition Width="100" />
                            <ColumnDefinition Width="200" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <ComboBox Grid.Column="0" ItemsSource="{Binding AvailableCombinationOperators}" SelectedItem="{Binding CombineOperator}" />
                        <ComboBox Grid.Column="1" ItemsSource="{Binding AvailableProperties}" SelectedItem="{Binding PropertyInfo}" DisplayMemberPath="Name" />
                        <ComboBox Grid.Column="2" ItemsSource="{Binding AvailableCompareOperators}" SelectedItem="{Binding CompareOperator}" />
                        <!--<TextBox Text="{Binding Value2.Value}" Grid.Column="3" />-->
                    <ContentControl Content="{Binding ValueControl}" Grid.Column="3"/>
                    <Button Grid.Column="4" Content="Delete" Command="Delete" CommandParameter="{Binding}" Margin="10,0,0,0" />
                    </Grid>
                </DataTemplate>
            </ListView.ItemTemplate>
         </ListView>
</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

Rabb Moshe Plotkin
United States United States
Co-director of Chabad Student Center @ SUNY New Paltz
Lecturer of Computer Science @ SUNY New Paltz

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160525.2 | Last Updated 2 Feb 2012
Article Copyright 2010 by Rabb Moshe Plotkin
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid