Click here to Skip to main content
15,892,005 members
Articles / Web Development / HTML

Signum Framework Tutorials Part 2 – Southwind Logic

Rate me:
Please Sign up or sign in to vote.
4.45/5 (6 votes)
15 Nov 2012LGPL325 min read 31.5K   1K   22  
In this part, we will focus on writing business logic, LINQ queries and explain inheritance
<UserControl
	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"
	xmlns:m="clr-namespace:Signum.Windows"
    xmlns:dq="clr-namespace:Signum.Entities.DynamicQuery;assembly=Signum.Entities"
	mc:Ignorable="d"
	x:Class="Signum.Windows.FilterBuilder"
	x:Name="UserControl">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="..\Resources.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid  Grid.Row="1" x:Name="filtros" MinHeight="60" Margin="2,0,0,0">
        <ListView IsSynchronizedWithCurrentItem="True" 
                      x:Name="lvFilters" 
                      m:Common.LabelVisible="False" 
                      KeyDown="lvFilters_KeyDown" 
                      Margin="2,0,26,4"
                      AllowDrop="True"
                      ItemsSource="{Binding Filters, ElementName=UserControl}"
                      DragDrop.DragOver="lvFilters_DragOver"
                      DragDrop.Drop="lvFilters_Drop"
                  >
            <ListView.ItemContainerStyle>
                <Style TargetType="{x:Type ListViewItem}">
                    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                </Style>
            </ListView.ItemContainerStyle>
            <ListView.View>
                <GridView AllowsColumnReorder="False">
                    <GridViewColumn Header="{m:Loc Field}" x:Name="firstColumn">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <m:QueryTokenRenderer Token="{Binding Token}" m:DragController.DragController="{Binding FilterDragController, ElementName=UserControl}" />
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Header="{m:Loc Operation}" Width="100">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Grid MinWidth="80" HorizontalAlignment="Stretch">
                                    <ComboBox 
                                        SelectedItem="{Binding Operation}" 
                                        ItemsSource="{Binding Token, Converter={x:Static m:Converters.TokenOperations}}"
                                        IsEnabled="{Binding Frozen, Converter={x:Static m:Converters.Not}}">
                                        <ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <TextBlock Text="{Binding Converter={x:Static m:Converters.EnumDescriptionConverter}}"/>
                                            </DataTemplate>
                                        </ComboBox.ItemTemplate>
                                    </ComboBox>
                                </Grid>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Header="{m:Loc Value}" Width="200">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Grid Loaded="Grid_Loaded" HorizontalAlignment="Stretch"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
        <Button x:Name="btRemove" Style="{StaticResource RoundButton}" Content="{StaticResource Remove}" HorizontalAlignment="Right" d:LayoutOverrides="Width" VerticalAlignment="Top" Click="btRemove_Click" Margin="0,4,4,0"/>
    </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 GNU Lesser General Public License (LGPLv3)


Written By
Software Developer (Senior) Signum Software
Spain Spain
I'm Computer Scientist, one of the founders of Signum Software, and the lead developer behind Signum Framework.

www.signumframework.com

I love programming in C#, Linq, Compilers, Algorithms, Functional Programming, Computer Graphics, Maths...

Comments and Discussions