Skip to content
Snippets Groups Projects
Commit f0f01823 authored by FabriceRonny.Bosshard's avatar FabriceRonny.Bosshard
Browse files

fixed test & refactored semester list item to be same as everywhere

parent ad2b2a4d
......@@ -62,7 +62,7 @@ public class DashboardViewModelTest
Assert.That(_vm.ToDos, Has.Count.EqualTo(1));
Assert.That(_vm.ToDos.First().Name, Is.EqualTo("TodoInNextUp"));
Assert.That(_vm.Courses, Is.Null);
Assert.That(_vm.DoubleCourseItems, Is.Null);
Assert.That(_vm.DoubleCourseItems, Is.Empty);
Assert.That(_vm.Lectures, Has.Count.EqualTo(0));
Assert.That(_vm.NextUpItems, Has.Count.EqualTo(1));
});
......
......@@ -39,44 +39,38 @@
<CollectionView ItemsSource="{Binding Semesters}"
SelectionMode="None"
IsVisible="{Binding Semesters, Converter={StaticResource IsNotEmptyConverter}}">
<CollectionView.ItemsLayout>
<LinearItemsLayout Orientation="Vertical" ItemSpacing="0" />
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="{x:Type model:Semester}">
<SwipeView>
<SwipeView.RightItems>
<SwipeItems>
<SwipeItem Text="Delete"
BackgroundColor="Red"
Command="{Binding Source={RelativeSource AncestorType={x:Type viewmodel:SettingsViewModel}}, Path=DeleteSemesterCommand}"
CommandParameter="{Binding}"/>
BackgroundColor="Red"
Command="{Binding Source={RelativeSource AncestorType={x:Type viewmodel:SettingsViewModel}}, Path=DeleteSemesterCommand}"
CommandParameter="{Binding}"/>
</SwipeItems>
</SwipeView.RightItems>
<VerticalStackLayout Padding="10,0"
BackgroundColor="White">
<VerticalStackLayout.GestureRecognizers>
<Frame Padding="10,0" Margin="5,2">
<Frame.GestureRecognizers>
<TapGestureRecognizer Command="{Binding Source={RelativeSource AncestorType={x:Type viewmodel:SettingsViewModel}}, Path=EditSemesterCommand}"
CommandParameter="{Binding}"/>
</VerticalStackLayout.GestureRecognizers>
<BoxView HeightRequest="0.5" BackgroundColor="Gray" Margin="-10,0" />
<Label Text="{ Binding Name }" MaxLines="1" FontAttributes="Bold" Padding="0,10,0,0"></Label>
<Label Padding="0,0,0,10">
<Label.Text>
<MultiBinding StringFormat="{}{0} - {1}">
<Binding Path="DateRange.StartString"/>
<Binding Path="DateRange.EndString"/>
</MultiBinding>
</Label.Text>
</Label>
</VerticalStackLayout>
CommandParameter="{Binding}"/>
</Frame.GestureRecognizers>
<Grid RowDefinitions="*,*">
<Label Text="{ Binding Name }" Grid.Row="0" MaxLines="1" FontAttributes="Bold" Padding="0,10,0,0"></Label>
<Label Padding="0,0,0,10" Grid.Row="1" TextColor="DimGray">
<Label.Text>
<MultiBinding StringFormat="{}{0} - {1}">
<Binding Path="DateRange.StartString"/>
<Binding Path="DateRange.EndString"/>
</MultiBinding>
</Label.Text>
</Label>
</Grid>
</Frame>
</SwipeView>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<BoxView HeightRequest="0.5"
BackgroundColor="Gray"
IsVisible="{Binding Semesters, Converter={StaticResource IsNotEmptyConverter}}"/>
</VerticalStackLayout>
</ContentPage.Content>
</ContentPage>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment