|
@@ -16,7 +16,7 @@ namespace comal.timesheets
|
|
|
|
|
|
public SetoutPacketGrid(SetoutShell shell)
|
|
|
{
|
|
|
- Margin = 0;
|
|
|
+ Margin = new Thickness(1, 1, 2, 1);
|
|
|
Padding = 0;
|
|
|
BorderColor = Color.Gray;
|
|
|
HasShadow = false;
|
|
@@ -41,23 +41,37 @@ namespace comal.timesheets
|
|
|
{
|
|
|
StackLayout layout = new StackLayout
|
|
|
{
|
|
|
- Orientation = StackOrientation.Vertical
|
|
|
+ Orientation = StackOrientation.Vertical,
|
|
|
+ Spacing = 0
|
|
|
};
|
|
|
|
|
|
layout.SetValue(Grid.ColumnProperty, 1);
|
|
|
|
|
|
foreach (var packet in shell.Packets)
|
|
|
{
|
|
|
- layout.Children.Add(CreatePacketView(packet));
|
|
|
+ ViewPosition position = ViewPosition.Middle;
|
|
|
+
|
|
|
+ if (packet == shell.Packets.First())
|
|
|
+ position = ViewPosition.First;
|
|
|
+ else if (packet == shell.Packets.Last())
|
|
|
+ position = ViewPosition.Last;
|
|
|
+
|
|
|
+ layout.Children.Add(CreatePacketView(packet, position));
|
|
|
}
|
|
|
|
|
|
return layout;
|
|
|
}
|
|
|
|
|
|
- private View CreatePacketView(MiniManufacturingPacket packet)
|
|
|
+ private View CreatePacketView(MiniManufacturingPacket packet, ViewPosition position)
|
|
|
{
|
|
|
Frame frame = new Frame();
|
|
|
- frame.Margin = 1;
|
|
|
+ frame.Margin = new Thickness(0, 1.5, 0, 1.5);
|
|
|
+
|
|
|
+ if(position == ViewPosition.First)
|
|
|
+ frame.Margin = new Thickness(0, 0, 0, 1.5);
|
|
|
+ else if (position == ViewPosition.Last)
|
|
|
+ frame.Margin = new Thickness(0, 1.5, 0, 0);
|
|
|
+
|
|
|
frame.Padding = 0;
|
|
|
frame.BorderColor = Color.Gray;
|
|
|
frame.HasShadow = false;
|
|
@@ -155,6 +169,13 @@ namespace comal.timesheets
|
|
|
|
|
|
return label;
|
|
|
}
|
|
|
+
|
|
|
+ enum ViewPosition
|
|
|
+ {
|
|
|
+ First,
|
|
|
+ Middle,
|
|
|
+ Last
|
|
|
+ }
|
|
|
#endregion
|
|
|
}
|
|
|
}
|