Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreach (Course c in items)
- {
- var lessons = context.Lessons.Where(l => l.CourseId == c.CourseId).Count();
- }
- <ListBox x:Name="listBoxLessons" Margin="10,47,10,10" VerticalContentAlignment="Top" HorizontalContentAlignment="Stretch" Background="{x:Null}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" BorderBrush="#00ABADB3" VerticalAlignment="Top">
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <UniformGrid Columns="4"/>
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid DockPanel.Dock="Top" Height="200" MaxHeight="200">
- <Grid.RowDefinitions>
- <RowDefinition Height="10*" MaxHeight="50"/>
- <RowDefinition Height="30*" MaxHeight="60"/>
- <RowDefinition Height="30*" MaxHeight="20"/>
- <RowDefinition Height="50*" MaxHeight="70"/>
- </Grid.RowDefinitions>
- <Border BorderThickness="0" BorderBrush="Red" Background="#FFF7F7F7" CornerRadius="5,5,0,0" Grid.Row="0">
- <Label Content="{Binding Name}" VerticalContentAlignment="Center" FontSize="18" FontWeight="Bold" HorizontalContentAlignment="Center"/>
- </Border>
- <Label x:Name="labelLessonAmount" Content="{Binding AmountLesson}" Grid.Row="1" VerticalContentAlignment="Center" FontSize="14" Background="#F7F7F7" VerticalAlignment="Stretch" HorizontalContentAlignment="Center" />
- <ProgressBar x:Name="progressBar" Grid.Row="2" Value="20" />
- <Button x:Name="btnStartCourse" Content="Start" BorderThickness="0" Style="{DynamicResource ButtonStyleListViewBox}" Grid.Row="3" Command="{x:Static commands:CourseOverviewWindowCommands.StartCourse}" CommandParameter="{Binding}" />
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- foreach (Course c in items)
- {
- course.AmountLesson = context.Lessons.Where(l => l.CourseId == c.CourseId).Count();
- }
Add Comment
Please, Sign In to add comment