Commit 56427ba5 authored by islater's avatar islater
Browse files

asdf

parent dabfd35d
......@@ -16,9 +16,9 @@
<Border BorderThickness="1" BorderBrush="Black" Margin="10,38,10,60">
<ListBox Name="ticket" HorizontalContentAlignment="Stretch" ItemsSource="{Binding Path=Items}" Margin="0,0,-1,-1">
<ListBox.ItemTemplate>
<DataTemplate >
<ListBox Name="ticket" HorizontalContentAlignment="Stretch" ItemsSource="{Binding Path=Items}" Margin="0,0,-1,-1">
<ListBox.ItemTemplate >
<DataTemplate >
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
......@@ -29,7 +29,7 @@
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="50"/>
</Grid.ColumnDefinitions>
<TextBlock PreviewMouseDown="ItemName_PreviewMouseDown" Name="ItemName" Text="{Binding}"></TextBlock>
<TextBlock MouseDown="ItemName_PreviewMouseDown" Name="ItemName" Text="{Binding}"></TextBlock>
<TextBlock Grid.Column="1" HorizontalAlignment="Left" Text="{Binding Path=Price, StringFormat=c}"/>
<Button DataContext="{Binding}" Grid.Column="2" Click="RemoveItemClicked" Name="RemoveListItem" Content="X" Background="Red" Width="32" Height="32"/>
<ListBox BorderThickness="0" Grid.Row="1" HorizontalAlignment="Center" ItemsSource="{Binding Path=SpecialInstructions}"/>
......
......@@ -31,7 +31,11 @@ namespace PointOfSale
}
/// <summary>
/// finds the current item and remvoes it from the list
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public void RemoveItemClicked(object sender, RoutedEventArgs e)
{
......@@ -44,12 +48,21 @@ namespace PointOfSale
}
private void ItemName_PreviewMouseDown(object sender, MouseButtonEventArgs e)
/// <summary>
/// pulls up the customization screen of the selected item
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ItemName_PreviewMouseDown(object sender, MouseEventArgs e)
{
IOrderItem i = (IOrderItem)((TextBlock)e.Source).DataContext;
var a = this.Parent;
MainWindow a = (MainWindow)((Grid)this.Parent).Parent;
if (((TextBlock)e.Source).DataContext is IOrderItem item)
{
a.ordercontrol.MainWindow.Child = new CustomizationControl(item);
}
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment