-
-
Notifications
You must be signed in to change notification settings - Fork 193
/
Copy pathMainPage.xaml
52 lines (50 loc) · 1.78 KB
/
MainPage.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
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="MauiMaps.MainPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:mauiMaps="clr-namespace:MauiMaps"
xmlns:models="clr-namespace:MauiMaps.Models"
xmlns:maps="http://schemas.microsoft.com/dotnet/2021/maui/maps"
x:DataType="mauiMaps:MainPageViewModel"
Shell.NavBarIsVisible="False">
<Grid>
<maps:Map
x:Name="MyMap"
ItemsSource="{Binding LocationPins}">
<maps:Map.ItemTemplate>
<DataTemplate x:DataType="{x:Type models:LocationPin}">
<mauiMaps:CustomPin
Location="{Binding Location}"
Address="{Binding Address}"
Label="{Binding Description}"
ImageSource="{Binding ImageSource}"
Type="Place"/>
</DataTemplate>
</maps:Map.ItemTemplate>
</maps:Map>
<ScrollView Orientation="Horizontal"
Margin="0,0,0,10"
BackgroundColor="White"
HorizontalOptions="Center"
VerticalOptions="End">
<HorizontalStackLayout>
<Button
Command="{Binding AddCommand}"
Text="Add new pin" />
<Button
Command="{Binding RemoveCommand}"
Text="Remove last pin" />
<Button
Command="{Binding RemoveAllCommand}"
Text="Clear all pins" />
<Button
Command="{Binding RealTimeLocationTrackerCommand}"
Text="Start real time location tracking" />
<Button
Command="{Binding RealTimeLocationTrackerCancelCommand}"
Text="Stop real time location tracking" />
</HorizontalStackLayout>
</ScrollView>
</Grid>
</ContentPage>