Click here to Skip to main content
15,896,730 members
Articles / Mobile Apps / Windows Mobile

Restaurant and Waiter project! (WPF - Windows Mobile)

Rate me:
Please Sign up or sign in to vote.
4.90/5 (77 votes)
22 Jan 2012Ms-PL2 min read 247.9K   89.2K   182  
Restaurant and Waiter project! (WPF - Windows Mobile)
<Window x:Class="Restaurant.ProductPopularityReportWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    MouseDown="Window_MouseDown" Style="{DynamicResource ModalWindowStyle}" 
        xmlns:Restaurant="clr-namespace:Restaurant" Foreground="White"
        Height="450" Width="600" FontFamily="Arial" FontSize="11" WindowStartupLocation="CenterOwner" 
        ShowInTaskbar="False" RenderTransformOrigin="0.5,0.5" x:Name="window" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" Title="Products Popularity Report" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" 
        xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit">
    <Window.Resources>
        <!-- ProductNameColumnTemplate -->
        <DataTemplate x:Key="ProductNameColumnTemplate">
            <TextBlock Height="20"  FontFamily="Arial" FontSize="14"  Text="{Binding Path=ProductName}" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
        </DataTemplate>

        <!--UnitNameColumnTemplate-->
        <DataTemplate x:Key="UnitNameColumnTemplate">
            <TextBlock Height="20" FontFamily="Arial" FontSize="14"  Text="{Binding Path=UnitName}" HorizontalAlignment="Stretch"  VerticalAlignment="Center"/>
        </DataTemplate>

        <!--OrderTimeColumnTemplate-->
        <DataTemplate x:Key="OrderTimeColumnTemplate">
            <TextBlock Height="20"  FontFamily="Arial" FontSize="14"  Text="{Binding Path=OrderTime}" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
        </DataTemplate>
        
        <Storyboard x:Key="StoryboardEntrance">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="{x:Null}" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="550" KeySpline="1,0,0,1"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="-30" KeySpline="1,0,0,1"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.7000000" Value="0" KeySpline="0,0,0,1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </Window.Resources>
    <Window.RenderTransform>
        <TransformGroup>
            <ScaleTransform ScaleX="1" ScaleY="1"/>
            <SkewTransform AngleX="0" AngleY="0"/>
            <RotateTransform Angle="0"/>
            <TranslateTransform X="0" Y="0"/>
        </TransformGroup>
    </Window.RenderTransform>
    <Window.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard Storyboard="{StaticResource StoryboardEntrance}"/>
        </EventTrigger>
    </Window.Triggers>
    <Window.CommandBindings>
        <CommandBinding Command="Close"
        Executed="CloseCommand_Executed"/>
    </Window.CommandBindings>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="0.122*"/>
            <RowDefinition Height="0.714*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <my:DatePicker Name="datePickerFromDate" Width="150" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="80,0,0,0" />
        <my:DatePicker Name="datePickerToDate" Width="150" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="280,0,0,0" />
        <TextBlock TextWrapping="Wrap" Foreground="#FFFFFFFF" Text="From Date:" d:LayoutOverrides="Height" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="20,0,0,0"/>
        <TextBlock HorizontalAlignment="Left" Foreground="#FFFFFFFF" Text="To:" TextWrapping="Wrap" d:LayoutOverrides="Height" VerticalAlignment="Center" Margin="250,0,0,0"/>
        <Button Style="{DynamicResource BlueButtonStyle}" HorizontalAlignment="Right" Width="100" Content="Show" Foreground="#FFFFFFFF" x:Name="btnShowResult" Height="26" VerticalAlignment="Center" Margin="0,0,50,0" Click="btnShowResult_Click" />

        <Restaurant:SortableListView  Grid.Row="1"  Margin="6,6,6,0" 
			Background="{x:Null}"  BorderBrush="{x:Null}"
			ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto"
			VirtualizingStackPanel.IsVirtualizing="True" ScrollViewer.CanContentScroll="True"
			SelectionMode="Single"  IsSynchronizedWithCurrentItem="True"
			ItemContainerStyle="{DynamicResource RestaurantEditListViewItemStyle}"
			Style="{DynamicResource RestaurantEditListViewStyle}" IsEnabled="True"  HorizontalAlignment="Stretch" VerticalAlignment="Top" x:Name="ResultGridView">
            <Restaurant:SortableListView.View >
                <GridView AllowsColumnReorder="False" >
                    <GridViewColumn Width="4" HeaderContainerStyle="{DynamicResource FirstColumnGridViewColumnHeader}" CellTemplate="{StaticResource EmptyColumnTemplate}"/>
                    <Restaurant:SortListViewColumn Header="Product Name" CellTemplate="{StaticResource ProductNameColumnTemplate}"  Width="300" SortProperty="ProductName" SortStyle="RestaurantDataGridViewColumnHeader" HeaderContainerStyle="{DynamicResource RestaurantDataGridViewColumnHeader}" />
                    <Restaurant:SortListViewColumn Header="Unit Name" CellTemplate="{StaticResource UnitNameColumnTemplate}"  Width="130" SortProperty="UnitName" SortStyle="RestaurantDataGridViewColumnHeader" HeaderContainerStyle="{DynamicResource RestaurantDataGridViewColumnHeader}" />
                    <Restaurant:SortListViewColumn Header="Order Time" CellTemplate="{StaticResource OrderTimeColumnTemplate}" Width="140" SortProperty="OrderTime" SortStyle="RestaurantDataGridViewColumnHeader" HeaderContainerStyle="{DynamicResource RestaurantDataGridViewColumnHeader}" />
                    <GridViewColumn Width="4" HeaderContainerStyle="{DynamicResource LastColumnGridViewColumnHeader}" CellTemplate="{StaticResource EmptyColumnTemplate}"/>
                </GridView>
            </Restaurant:SortableListView.View>
        </Restaurant:SortableListView>

        <Button Style="{DynamicResource BlueButtonStyle}" Content="Print" x:Name="btnPrint" Foreground="#FFFFFFFF" Grid.Row="2" Height="26" VerticalAlignment="Top" Width="100" HorizontalAlignment="Center" Click="btnPrint_Click"/>
    </Grid>
</Window>

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 Microsoft Public License (Ms-PL)


Written By
Software Developer
Canada Canada
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions