-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWatchlist.xaml
103 lines (95 loc) · 4.66 KB
/
Watchlist.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
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:model="clr-namespace:StockTracker.Model"
x:Class="StockTracker.Watchlist"
Title="Watchlist">
<Grid x:Name="watchlist_page_layout"
ColumnDefinitions="*, *"
RowDefinitions="*, Auto, Auto" >
<CollectionView x:Name="watchlist_items_display"
HorizontalOptions="Center"
Grid.ColumnSpan="2"
Grid.Row="0"
Grid.Column="0"
VerticalOptions="Start">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="model:Stock">
<SwipeView >
<SwipeView.LeftItems>
<SwipeItems SwipeBehaviorOnInvoked="Close">
<SwipeItem Text="{Binding ticker_name}"
IconImageSource="trash_icon.png"
BackgroundColor="red"
Invoked="Swipe_Remove" />
</SwipeItems>
</SwipeView.LeftItems>
<Grid RowDefinitions="*, Auto"
ColumnDefinitions="*, Auto, 60"
Padding="10" >
<Label Text="{Binding ticker_name}"
Grid.Row="0"
Grid.Column="0"
FontSize="24" />
<Label Text="{Binding company_name}"
Grid.Row="1"
Grid.Column="0"
FontSize="12" />
<Label Text="{Binding ticker_price,
StringFormat='${0:0.00}'}"
Grid.RowSpan="2"
Grid.Row="0"
Grid.Column="1"
FontSize="20"
Margin="10"
VerticalOptions="Center"
HorizontalOptions="End" />
<Label Text="{Binding ticker_dollar_day_change,
StringFormat='${0:0.00}'}"
Grid.Row="0"
Grid.Column="2"
FontSize="14"
HorizontalOptions="End"
VerticalOptions="Start"/>
<Label Text="{Binding ticker_percent_day_change,
StringFormat='{0:0.00}%'}"
Grid.Row="1"
Grid.Column="2"
FontSize="14"
HorizontalOptions="End"
VerticalOptions="End"/>
</Grid>
</SwipeView>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<Button Text="Add"
FontAttributes="Bold"
FontSize="16"
Grid.Row="1"
Grid.Column="0"
Margin="8"
Clicked="Create_Stock_Entity" />
<Button x:Name="sort_button"
FontAttributes="Bold"
FontSize="16"
Grid.Row="1"
Grid.Column="1"
Margin="8"
Clicked="Sort_Watchlist" />
<Button Text="Remove"
FontAttributes="Bold"
FontSize="16"
Grid.Row="2"
Grid.Column="0"
Margin="8"
Clicked="Create_Stock_Entity" />
<Button Text="Clear"
FontAttributes="Bold"
FontSize="16"
Grid.Row="2"
Grid.Column="1"
Margin="8"
Clicked="Clear_Watchlist" />
</Grid>
</ContentPage>