Révision 18f910c6 GES_PAC/View/CreateDayView.xaml

Voir les différences:

GES_PAC/View/CreateDayView.xaml
2 2
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3 3
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4 4
             xmlns:vm="clr-namespace:GES_PAC.ViewModel"
5
             xmlns:tools="clr-namespace:GES_PAC.View.Tools"
5 6
             x:Class="GES_PAC.View.CreateDayView"
6 7
             x:DataType="vm:CreateDayViewModel">
7 8

  
8
    <Grid Padding="20" RowDefinitions="Auto, *">
9

  
10
        <Button Text="Retour"
11
                BackgroundColor="DarkRed"
12
                TextColor="White"
13
                CornerRadius="10"
14
                Padding="10"
15
                FontSize="14"
16
                HorizontalOptions="Start"
17
                VerticalOptions="Start"
18
                Command="{Binding ReturnCommand}"/>
19

  
20
        <VerticalStackLayout Grid.Row="1" Spacing="20"
21
                             VerticalOptions="CenterAndExpand"
22
                             HorizontalOptions="Center">
23

  
24
            <Label Text="Informations de la journée"
25
                   FontSize="20"
26
                   FontAttributes="Bold"
27
                   HorizontalOptions="Center" />
28
            <VerticalStackLayout Spacing="15" WidthRequest="300">
29
                <!-- Lieu -->
30
                <VerticalStackLayout>
31
                
32
                        <Label Text="Elevage" FontSize="14" TextColor="Gray" FontAttributes="Bold"/>
33
                
34
                        <Grid ColumnDefinitions="*, Auto" Padding="5">
9
    <Grid>
10
        <StackLayout BackgroundColor="White" Spacing="50">
11
            <tools:ConnectionIndicatorView />
12
            <ScrollView>
13

  
14
                <VerticalStackLayout Grid.Row="1" Spacing="30">
15

  
16
                    <Label Text="Informations de la journée"
17
                       FontSize="20"
18
                       FontAttributes="Bold"
19
                       HorizontalOptions="Center" />
20
                    <VerticalStackLayout Spacing="15" WidthRequest="300">
21

  
22
                        <!-- Lieu -->
23
                        <VerticalStackLayout>
24

  
25
                            <Label Text="Elevage" FontSize="14" TextColor="Gray" FontAttributes="Bold"/>
26

  
35 27
                            <Picker Grid.Column="0"
36 28
                                ItemsSource="{Binding Places}" 
37 29
                                SelectedItem="{Binding SelectedPlace}"
38 30
                                FontSize="16"
39 31
                                Title="Sélectionner un élevage"/>
40 32

  
41
                            <Button Grid.Column="1"
42
                                Text="+" 
43
                                Command="{Binding AddPlaceCommand}"
44
                                BackgroundColor="Gray"
45
                                TextColor="White"
46
                                CornerRadius="5"
47
                                Margin="10,0,0,0"/>
48
                        </Grid>
49
                
50
                        <Label Text="Sélectionnez un lieu"
51
                            FontSize="12"
52
                            TextColor="Red"
53
                            IsVisible="{Binding PlaceError}"/>
54
                </VerticalStackLayout>
33
                            <Label Text="Sélectionnez un lieu"
34
                                FontSize="12"
35
                                TextColor="Red"
36
                                IsVisible="{Binding PlaceError}"/>
37
                        </VerticalStackLayout>
55 38

  
56
                <!-- Technicien -->
57
                <VerticalStackLayout>
58
                    <Label Text="Technicien" FontSize="14" TextColor="Gray" FontAttributes="Bold"/>
59
                
60
                    <Grid ColumnDefinitions="*, Auto" Padding="5">
61
                        <Picker Grid.Column="0"
62
                            ItemsSource="{Binding Persons}" 
63
                            SelectedItem="{Binding SelectedPerson}"
64
                            FontSize="16"
65
                            Title="Sélectionner un technicien"/>
66

  
67
                        <Button Grid.Column="1"
68
                            Text="+" 
69
                            Command="{Binding AddPersonCommand}"
70
                            BackgroundColor="Gray"
71
                            TextColor="White"
72
                            CornerRadius="5"
73
                            Margin="10,0,0,0"/>
74
                    </Grid>
75
                    <Label Text="Sélectionnez un technicien"
76
                        FontSize="12"
77
                        TextColor="Red"
78
                        IsVisible="{Binding PersonError}"/>
79
                </VerticalStackLayout>
39
                        <!-- Technicien -->
40
                        <VerticalStackLayout>
41
                            <Label Text="Technicien" FontSize="14" TextColor="Gray" FontAttributes="Bold"/>
80 42

  
43
                            <Picker Grid.Column="0"
44
                                ItemsSource="{Binding Persons}" 
45
                                SelectedItem="{Binding SelectedPerson}"
46
                                FontSize="16"
47
                                Title="Sélectionner un technicien"/>
81 48

  
82
                <!-- Espèce -->
83
                <VerticalStackLayout>
84
                    <Label Text="Espèce" FontSize="14" TextColor="Gray" FontAttributes="Bold"/>
85
                    <Entry Text="{Binding Espece}" FontSize="16" TextColor="Black" Placeholder="Entrer l'espèce"/>
86
                    <Label Text="Min. 3 caractères"
87
                        FontSize="12"
88
                        TextColor="Red"
89
                        IsVisible="{Binding EspeceError}"/>
90
                </VerticalStackLayout>
49
                            <Label Text="Sélectionnez un technicien"
50
                                FontSize="12"
51
                                TextColor="Red"
52
                                IsVisible="{Binding PersonError}"/>
53
                        </VerticalStackLayout>
91 54

  
92
                <!-- Régime alimentaire -->
93
                <VerticalStackLayout>
94
                <Label Text="Régime alimentaire" FontSize="14" TextColor="Gray" FontAttributes="Bold"/>
95
                <Entry Text="{Binding Regime}" FontSize="16" TextColor="Black" Placeholder="Entrer le régime alimentaire"/>
96
                <Label Text="Min. 3 caractères"
97
                    FontSize="12"
98
                    TextColor="Red"
99
                    IsVisible="{Binding RegimeError}"/>
100
                </VerticalStackLayout>
55
                        <!-- Espèce -->
56
                        <VerticalStackLayout>
57
                            <Label Text="Espèce" FontSize="14" TextColor="Gray" FontAttributes="Bold"/>
58
                            <Entry Text="{Binding Espece}" FontSize="16" TextColor="Black" Placeholder="Entrer l'espèce"/>
59
                            <Label Text="Min. 3 caractères"
60
                                FontSize="12"
61
                                TextColor="Red"
62
                                IsVisible="{Binding EspeceError}"/>
63
                        </VerticalStackLayout>
101 64

  
102
            </VerticalStackLayout>
65
                        <!-- Régime alimentaire -->
66
                        <VerticalStackLayout>
67
                            <Label Text="Régime alimentaire" FontSize="14" TextColor="Gray" FontAttributes="Bold"/>
68
                            <Entry Text="{Binding Regime}" FontSize="16" TextColor="Black" Placeholder="Entrer le régime alimentaire"/>
69
                            <Label Text="Min. 3 caractères"
70
                                FontSize="12"
71
                                TextColor="Red"
72
                                IsVisible="{Binding RegimeError}"/>
73
                        </VerticalStackLayout>
103 74

  
104
            <Button Text="Enregistrer"
105
                    BackgroundColor="Green"
106
                    TextColor="White"
107
                    CornerRadius="10"
108
                    Padding="15"
109
                    FontSize="16"
110
                    HorizontalOptions="Center"
111
                    WidthRequest="180"
112
                    IsEnabled="{Binding IsFormValid}"
113
                    Command="{Binding CreateDayCommand}"/>
75
                    </VerticalStackLayout>
76
                </VerticalStackLayout>
77
            </ScrollView>
78
            <StackLayout
79
                Margin="10"
80
                HorizontalOptions="CenterAndExpand"
81
                Orientation="Horizontal"
82
                VerticalOptions="FillAndExpand">
114 83

  
115
        </VerticalStackLayout>
84
                <Button 
85
                    Text="Créer une journée"
86
                    Command="{Binding CreateDayCommand}"
87
                    Style="{StaticResource btnNormal}"
88
                    IsEnabled="{Binding IsFormValid}"
89
                    VerticalOptions="End"/>
90
            </StackLayout>
91
        </StackLayout>
92
        <Grid Grid.RowSpan="1" IsVisible="{Binding IsBusy}">
93
            <Border StrokeThickness="0"
94
                            Background="Black"
95
                            Opacity="0.5"
96
                            Padding="20"
97
                            WidthRequest="160"
98
                            HeightRequest="160"
99
                            HorizontalOptions="Center"
100
                            VerticalOptions="Center"
101
                            StrokeShape="RoundRectangle 20">
116 102

  
103
                <VerticalStackLayout HorizontalOptions="Center" VerticalOptions="Center">
104
                    <ActivityIndicator IsRunning="True" Color="White" />
105
                    <Label Text="Chargement..."
106
                            FontSize="14"
107
                            TextColor="white"
108
                            HorizontalOptions="Center"/>
109
                </VerticalStackLayout>
110
            </Border>
111
        </Grid>
117 112
    </Grid>
118 113

  
119 114
</ContentPage>

Formats disponibles : Unified diff