Guest User

Untitled

a guest
Dec 11th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. foreach (Course c in items)
  2. {
  3. var lessons = context.Lessons.Where(l => l.CourseId == c.CourseId).Count();
  4. }
  5.  
  6. <ListBox x:Name="listBoxLessons" Margin="10,47,10,10" VerticalContentAlignment="Top" HorizontalContentAlignment="Stretch" Background="{x:Null}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" BorderBrush="#00ABADB3" VerticalAlignment="Top">
  7. <ListBox.ItemsPanel>
  8. <ItemsPanelTemplate>
  9. <UniformGrid Columns="4"/>
  10. </ItemsPanelTemplate>
  11. </ListBox.ItemsPanel>
  12.  
  13. <ListBox.ItemTemplate>
  14. <DataTemplate>
  15. <Grid DockPanel.Dock="Top" Height="200" MaxHeight="200">
  16. <Grid.RowDefinitions>
  17. <RowDefinition Height="10*" MaxHeight="50"/>
  18. <RowDefinition Height="30*" MaxHeight="60"/>
  19. <RowDefinition Height="30*" MaxHeight="20"/>
  20. <RowDefinition Height="50*" MaxHeight="70"/>
  21. </Grid.RowDefinitions>
  22. <Border BorderThickness="0" BorderBrush="Red" Background="#FFF7F7F7" CornerRadius="5,5,0,0" Grid.Row="0">
  23. <Label Content="{Binding Name}" VerticalContentAlignment="Center" FontSize="18" FontWeight="Bold" HorizontalContentAlignment="Center"/>
  24. </Border>
  25. <Label x:Name="labelLessonAmount" Content="{Binding AmountLesson}" Grid.Row="1" VerticalContentAlignment="Center" FontSize="14" Background="#F7F7F7" VerticalAlignment="Stretch" HorizontalContentAlignment="Center" />
  26. <ProgressBar x:Name="progressBar" Grid.Row="2" Value="20" />
  27. <Button x:Name="btnStartCourse" Content="Start" BorderThickness="0" Style="{DynamicResource ButtonStyleListViewBox}" Grid.Row="3" Command="{x:Static commands:CourseOverviewWindowCommands.StartCourse}" CommandParameter="{Binding}" />
  28. </Grid>
  29. </DataTemplate>
  30. </ListBox.ItemTemplate>
  31.  
  32. foreach (Course c in items)
  33. {
  34. course.AmountLesson = context.Lessons.Where(l => l.CourseId == c.CourseId).Count();
  35. }
Add Comment
Please, Sign In to add comment