forked from KTLaughter/WPF-Inventory-App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInventoryDetailsView.xaml
175 lines (153 loc) · 10.9 KB
/
InventoryDetailsView.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<UserControl x:Class="InventoryAppV1.InventoryDetailsView"
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:InventoryAppV1"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Border>
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFEDB470" Offset="1"/>
<GradientStop Color="#FFD05A00" Offset="0"/>
</LinearGradientBrush>
</Border.Background>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Top">
<TextBlock Text="{Binding InventoryName}" FontSize="40" FontWeight="Bold" FontFamily="Segoe UI Black" Foreground="#FFFFE3A7" HorizontalAlignment="Center" TextAlignment="Center">
<TextBlock.Effect>
<DropShadowEffect Color="Black" Direction="300" ShadowDepth="5" Opacity="0.5"/>
</TextBlock.Effect>
</TextBlock>
</StackPanel>
</Border>
<Border BorderBrush="Black" BorderThickness="1" Width="230" Height="30" CornerRadius="15" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0, 0 ,0 ,11.8">
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFB3A178"/>
<GradientStop Color="#FFB3A178" Offset="0.994"/>
<GradientStop Color="#FFFCE1A5" Offset="0.5"/>
</LinearGradientBrush>
</Border.Background>
</Border>
<StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" Margin="0,0,0,12" HorizontalAlignment="Center">
<TextBox Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}" Width="200" Height="30" VerticalAlignment="Center"
BorderThickness="0" Background="Transparent" Padding="5" FontFamily="Segoe UI Black">
</TextBox>
<Button Command="{Binding ClearSearchCommand}" Height="30" Width="30" Background="Transparent" BorderThickness="0">
<Image Source="Pictures/ClearIcon.png" Width="38" Height="27" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Button>
</StackPanel>
<Border BorderBrush="Black" BorderThickness="1" CornerRadius="15" Margin="130,56,130,56">
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF918363"/>
<GradientStop Color="#FF918363" Offset="1"/>
<GradientStop Color="#FFF0D59B" Offset="0.5"/>
</LinearGradientBrush>
</Border.Background>
</Border>
<ListBox ItemsSource="{Binding FilteredItems}" MouseDoubleClick="ItemDoubleClick" Margin="10,56,10,56" HorizontalAlignment="Center" >
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="3"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Border BorderBrush="Black" BorderThickness="1" CornerRadius="10" Margin="10" Width="209" Height="140">
<Border.Background>
<RadialGradientBrush>
<GradientStop Color="#FFD9BC8C"/>
<GradientStop Color="#FFBCA073" Offset="1"/>
<GradientStop Color="#FFD9BC8C" Offset="0.5"/>
</RadialGradientBrush>
</Border.Background>
<StackPanel HorizontalAlignment="Center" Width="398">
<StackPanel Orientation="Horizontal" Width="191" >
<TextBlock Text="Name: " VerticalAlignment="Bottom" FontFamily="Segoe UI Black" FontSize="13.5" Foreground="#FF755725"/>
<TextBlock Text="{Binding ItemName}" HorizontalAlignment="Center" Margin="0,5,0,0" FontFamily="Segoe UI Black" FontSize="13.5"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Width="191" >
<TextBlock Text="Cost: " VerticalAlignment="Bottom" FontFamily="Segoe UI Black" FontSize="13.5" Foreground="#FF755725"/>
<TextBlock Text="{Binding Cost, StringFormat='{}${0:F2}'}" HorizontalAlignment="Center" Margin="0,5,0,0" FontFamily="Segoe UI Black" FontSize="13.5"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Width="191" >
<TextBlock Text="Quantity: " VerticalAlignment="Bottom" FontFamily="Segoe UI Black" FontSize="13.5" Foreground="#FF755725"/>
<TextBlock Text="{Binding Quantity}" HorizontalAlignment="Center" Margin ="0,5,0,0" FontFamily="Segoe UI Black" FontSize="13.5"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Height="75" Width="216" >
<Button Command="{Binding DataContext.EditItemCommand, RelativeSource={RelativeSource AncestorType=UserControl}}" CommandParameter="{Binding}" Margin="0,0,0,5" Width="100" Height="40" VerticalAlignment="Bottom" Background="Transparent" BorderThickness="0" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
<Image Source="Pictures/EditIcon.png" Width="90" Height="65" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Button>
<Button Command="{Binding DataContext.DeleteItemCommand, RelativeSource={RelativeSource AncestorType=UserControl}}" CommandParameter="{Binding}" Margin="15,0,0,5" Width="100" Height="40" VerticalAlignment="Bottom" Background="Transparent" BorderThickness="0" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
<Image Source="Pictures/DeleteIcon.png" Width="90" Height="65" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Button>
</StackPanel>
</StackPanel>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Margin" Value="10" />
</Style>
</ListBox.ItemContainerStyle>
<ListBox.Style>
<Style TargetType="ListBox">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBox">
<Border BorderBrush="#00000000" BorderThickness="1" CornerRadius="15">
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFB3A178"/>
<GradientStop Color="#FFB3A178" Offset="1"/>
<GradientStop Color="#FFFFE3A7" Offset="0.5"/>
</LinearGradientBrush>
</Border.Background>
<ScrollViewer>
<ItemsPresenter />
</ScrollViewer>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.Style>
</ListBox>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,10,50,0" Background="#FFD15D04">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Top">
<TextBlock Text=" Total Items:" FontSize="14" FontWeight="Bold" FontFamily="Segoe UI Black" Foreground="#FFFFE3A7" HorizontalAlignment="Center" TextAlignment="Center">
<TextBlock.Effect>
<DropShadowEffect Color="Black" Direction="300" ShadowDepth="5" Opacity="0.5"/>
</TextBlock.Effect>
</TextBlock>
<TextBlock Text="Total Cost:" FontSize="14" FontWeight="Bold" FontFamily="Segoe UI Black" Foreground="#FFFFE3A7" HorizontalAlignment="Center" TextAlignment="Center">
<TextBlock.Effect>
<DropShadowEffect Color="Black" Direction="300" ShadowDepth="5" Opacity="0.5"/>
</TextBlock.Effect>
</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Top">
<TextBlock Text="{Binding TotalItems}" FontSize="14" FontWeight="Bold" FontFamily="Segoe UI Black" Foreground="#FFFFE3A7" HorizontalAlignment="Left" Margin="4,0,0,0" >
<TextBlock.Effect>
<DropShadowEffect Color="Black" Direction="300" ShadowDepth="5" Opacity="0.5"/>
</TextBlock.Effect>
</TextBlock>
<TextBlock Text="{Binding TotalCost, StringFormat={}{0:C}}" FontSize="14" FontWeight="Bold" FontFamily="Segoe UI Black" Foreground="#FFFFE3A7" HorizontalAlignment="Center" TextAlignment="Center">
<TextBlock.Effect>
<DropShadowEffect Color="Black" Direction="300" ShadowDepth="5" Opacity="0.5"/>
</TextBlock.Effect>
</TextBlock>
</StackPanel>
</StackPanel>
<Button Command="{Binding AddItemCommand}" VerticalAlignment="Bottom" Margin="0,0,10,2" Width="100" Height="50" Background="Transparent" BorderThickness="0" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" HorizontalAlignment="Right">
<Image Source="Pictures/AddIcon.png" Width="100" Height="100" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Button>
<Button Command="{Binding BackToMainCommand}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,1,0,0" Width="50" Height="50" Background="Transparent" BorderThickness="0" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
<Image Source="Pictures/HomeIcon.png" Width="50" Height="50" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Button>
</Grid>
</UserControl>