57d2ab60a7
Created and binded a View, created logic behind Cart Product Model
88 lines
3.6 KiB
XML
88 lines
3.6 KiB
XML
<UserControl x:Class="RMWPFUserInterface.Views.SalesView"
|
|
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:local="clr-namespace:RMWPFUserInterface.Views"
|
|
mc:Ignorable="d" Background="White" FontSize="24"
|
|
d:DesignHeight="550" d:DesignWidth="800">
|
|
<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="*" />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="auto"/>
|
|
<ColumnDefinition Width="auto"/>
|
|
<ColumnDefinition Width="auto"/>
|
|
<ColumnDefinition Width="auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<!-- Header -->
|
|
<TextBlock Text="Sales Page" FontSize="48"
|
|
Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3"
|
|
Margin="0 0 0 30"/>
|
|
<!-- Column 0 -->
|
|
<TextBlock Text="Items" Grid.Row="1" Grid.Column="0"/>
|
|
<ListBox x:Name="Products" Grid.Row="2" Grid.Column="0"
|
|
MinHeight="200" MinWidth="150" SelectedItem="{Binding SelectedProduct}">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding ProductName}"/>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
|
|
<!-- Column 1 -->
|
|
<StackPanel Orientation="Vertical" Grid.Column="1"
|
|
Grid.Row="2" Margin="20 0" >
|
|
<TextBlock Text="Quantity" />
|
|
<TextBox x:Name="ItemQuantity" MinWidth="100" Margin="0 0 0 10"/>
|
|
<Button x:Name="AddToCart" Content="Add to Cart" Margin="0 0 0 30"
|
|
Padding="5"/>
|
|
<Button x:Name="RemoveFromCart" Content="Remove from Cart"
|
|
Padding="5"/>
|
|
</StackPanel>
|
|
|
|
<!-- Column 2 -->
|
|
<TextBlock Text="Cart" Grid.Row="1" Grid.Column="2"/>
|
|
<ListBox x:Name="Cart" Grid.Row="2" Grid.Column="2"
|
|
MinHeight="200" MinWidth="150">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding DisplayText}"/>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
|
|
<DockPanel Grid.Row="3" Grid.Column="2">
|
|
<TextBlock Text="SubTotal: " Margin="0 0 15 0"/>
|
|
<TextBlock x:Name="SubTotal" Text="$0.00"
|
|
TextAlignment="Right"/>
|
|
</DockPanel>
|
|
|
|
<DockPanel Grid.Row="4" Grid.Column="2">
|
|
<TextBlock Text="Tax: " />
|
|
<TextBlock x:Name="Tax" Text="$0.00"
|
|
TextAlignment="Right"/>
|
|
</DockPanel>
|
|
|
|
<DockPanel Grid.Row="5" Grid.Column="2">
|
|
<TextBlock Text="Total: " />
|
|
<TextBlock x:Name="Total" Text="$0.00"
|
|
TextAlignment="Right"/>
|
|
</DockPanel>
|
|
|
|
<Button x:Name="CheckOut" Grid.Row="6" Grid.Column="2"
|
|
Content="Check Out"
|
|
Margin="0 20 0 0" Padding="5"/>
|
|
</Grid>
|
|
</UserControl>
|