|
1 | 1 | <?xml version="1.0" encoding="utf-8" ?> |
2 | | -<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
3 | | - xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" |
4 | | - xmlns:models="clr-namespace:TodoApp.MAUI.Models" |
5 | | - xmlns:viewmodels="clr-namespace:TodoApp.MAUI.ViewModels" |
6 | | - x:DataType="viewmodels:MainViewModel" |
7 | | - x:Class="TodoApp.MAUI.MainPage" |
8 | | - Title="TodoApp"> |
| 2 | +<ContentPage |
| 3 | + x:Class="TodoApp.MAUI.MainPage" |
| 4 | + xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
| 5 | + xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" |
| 6 | + xmlns:models="clr-namespace:TodoApp.MAUI.Models" |
| 7 | + xmlns:viewmodels="clr-namespace:TodoApp.MAUI.ViewModels" |
| 8 | + Title="TodoApp" |
| 9 | + x:DataType="viewmodels:MainViewModel"> |
9 | 10 | <NavigationPage.TitleView> |
10 | 11 | <StackLayout Style="{StaticResource titleViewContainer}"> |
11 | 12 | <Label Style="{StaticResource titleViewLabel}">TodoApp</Label> |
12 | | - <ImageButton Style="{StaticResource titleViewRefreshIcon}" Command="{Binding RefreshItemsCommand}" /> |
| 13 | + <ImageButton Command="{Binding RefreshItemsCommand}" Style="{StaticResource titleViewRefreshIcon}" /> |
13 | 14 | </StackLayout> |
14 | 15 | </NavigationPage.TitleView> |
15 | 16 |
|
16 | | - <Grid AbsoluteLayout.LayoutBounds="0,0,1,1" AbsoluteLayout.LayoutFlags="All" BackgroundColor="Azure"> |
| 17 | + <Grid |
| 18 | + AbsoluteLayout.LayoutBounds="0,0,1,1" |
| 19 | + AbsoluteLayout.LayoutFlags="All" |
| 20 | + BackgroundColor="Azure"> |
17 | 21 | <Grid.RowDefinitions> |
18 | 22 | <RowDefinition Height="*" /> |
19 | 23 | <RowDefinition Height="Auto" /> |
|
22 | 26 | <ColumnDefinition Width="*" /> |
23 | 27 | </Grid.ColumnDefinitions> |
24 | 28 |
|
25 | | - <!-- List of items --> |
26 | | - <ListView ItemsSource="{Binding Items}" ItemTapped="OnListItemTapped"> |
| 29 | + <!-- List of items --> |
| 30 | + <ListView ItemTapped="OnListItemTapped" ItemsSource="{Binding Items}"> |
27 | 31 | <ListView.ItemTemplate> |
28 | 32 | <DataTemplate x:DataType="models:TodoItem"> |
29 | 33 | <ViewCell> |
|
37 | 41 | </Grid.ColumnDefinitions> |
38 | 42 |
|
39 | 43 | <Label Style="{StaticResource listItemTitle}" Text="{Binding Title}" /> |
40 | | - <Image Grid.Column="1" IsVisible="{Binding IsComplete}" Style="{StaticResource listItemIcon}" /> |
| 44 | + <Image |
| 45 | + Grid.Column="1" |
| 46 | + IsVisible="{Binding IsComplete}" |
| 47 | + Style="{StaticResource listItemIcon}" /> |
41 | 48 | </Grid> |
42 | 49 | </ViewCell> |
43 | 50 | </DataTemplate> |
44 | 51 | </ListView.ItemTemplate> |
45 | 52 | </ListView> |
46 | 53 |
|
47 | | - <!-- Entry box --> |
| 54 | + <!-- Entry box --> |
48 | 55 | <Frame Grid.Row="1" Style="{StaticResource roundedCornerFrame}"> |
49 | 56 | <HorizontalStackLayout> |
50 | 57 | <Image Style="{StaticResource addItemIcon}" /> |
51 | | - <Entry |
52 | | - x:Name="addItemEntry" |
53 | | - Style="{StaticResource addItemEntry}" |
| 58 | + <Entry |
| 59 | + x:Name="addItemEntry" |
54 | 60 | Placeholder="Enter Todo Item Text" |
55 | 61 | ReturnCommand="{Binding AddItemCommand}" |
56 | | - ReturnCommandParameter="{Binding Source={x:Reference addItemEntry}}" /> |
| 62 | + ReturnCommandParameter="{Binding Text, Source={x:Reference addItemEntry}}" |
| 63 | + Style="{StaticResource addItemEntry}" /> |
57 | 64 | </HorizontalStackLayout> |
58 | 65 | </Frame> |
59 | 66 | </Grid> |
|
0 commit comments