UI Update

This commit is contained in:
wangxiner55 2024-09-25 19:00:49 +08:00
parent a5d33f9f99
commit ab4d872f3e
17 changed files with 1004 additions and 299 deletions

View File

@ -34,24 +34,25 @@ namespace StudentManager.Common
public class DetailErrorSetInfo
{
public int TotalCount { get; set; } = 0;
public int TotalErrorCount { get; set; } = 0;
public int CorrectCount { get; set; } = 0;
public int ErrorCount { get; set; } = 0;
public int TotalQuestionsCount { get; set; } = 0;
public int TotalErrorSetQuestionsCount { get; set; } = 0;
public int CorrectCount { get; set; } = 0;
public int ErrorCount { get; set; } = 0;
public float ErrorRate { get; set; } = 0;
public float CorrectRate { get; set; } = 0;
}
public class ErrorSet
{
public int TotalCount { get; set; } = 0;
public int CorrectCount { get; set; } = 0;
public int TotalCount { get { return Errores.Count; } }
public int CorrectCount { get { return CorrectArray.Count; } }
public int ErrorCount { get { return ErrorArray.Count; } }
public Dictionary<int, ErrorBase> Errores { get; set; } = new Dictionary<int, ErrorBase>();
public List<int> ErrorArray { get; set; } = new List<int>();
public List<int> CorrectArray { get; set; } = new List<int>();
public int CorrectThresholds { get; set; } = 2;
public void InitErrorSetData()
public void UpdateErrorSetData()
{
foreach (var item in Errores)
{
@ -64,11 +65,11 @@ namespace StudentManager.Common
{
return new DetailErrorSetInfo
{
TotalCount = QuestionLib.GetQuestionCount(),
TotalErrorCount = Errores.Count(),
TotalQuestionsCount = QuestionLib.TotalCount,
TotalErrorSetQuestionsCount = Errores.Count(),
CorrectCount = CorrectArray.Count(),
ErrorCount = ErrorArray.Count(),
ErrorRate = QuestionLib.GetQuestionCount() == 0 ? 100 : ErrorArray.Count() / QuestionLib.GetQuestionCount(),
ErrorRate = QuestionLib.TotalCount == 0 ? 100 : ErrorArray.Count() / QuestionLib.TotalCount,
CorrectRate = Errores.Count() == 0 ? 100 : CorrectArray.Count() / Errores.Count()
};
}
@ -108,13 +109,6 @@ namespace StudentManager.Common
}
}
public void AddErrorQuestion(int id)
{
}
public void AddCorrectQuestion(int id)
{
}
public void AddErrorQuestion(QuestionBase question)
{
@ -127,24 +121,19 @@ namespace StudentManager.Common
}
else
{
TotalCount++;
Errores.Add(question.ID, new ErrorBase { QuestionBase = { ID = question.ID } });
ErrorArray.Add(question.ID);
}
}
public void AddErrorQuestion(QuestionData question)
{
}
public void AddCorrectQuestion(QuestionBase id)
{
if (Errores.ContainsKey(id.ID))
{
CorrectCount++;
Errores[id.ID].QuestionBase.Status = true;
Errores[id.ID].CorrectCount++;
Errores[id.ID].TotalUseCount++;
CompareToCorrectArray(Errores[id.ID]);
}

View File

@ -17,7 +17,7 @@ namespace StudentManager.Common
public bool Status { get; set; } = false;
}
public class DetailHomeWorkInfo
public class DetailHomeWorkInfo : BindableBase
{
//public DetailQuestionBase QuestionData { get; set; } = new DetailQuestionBase();
public QuestionData QuestionData { get; set; } = new QuestionData();
@ -44,6 +44,7 @@ namespace StudentManager.Common
public int ErrorCount { get; set; } = 0;
public int CorrectCount { get; set; } = 0;
public ObservableCollection<DetailHomeWorkInfo> GetDetailHomeWorkList()
{
ObservableCollection<DetailHomeWorkInfo> list = new ObservableCollection<DetailHomeWorkInfo>();
@ -68,7 +69,7 @@ namespace StudentManager.Common
return list;
}
private void FreshData()
public void UpdateData()
{
CorrectCount = 0;
ErrorCount = 0;
@ -85,19 +86,19 @@ namespace StudentManager.Common
public void AddHomeWork(QuestionBase workInfo)
{
Questions.Add(workInfo);
FreshData();
UpdateData();
}
public void AddHomeWork(int id)
{
Questions.Add(new QuestionBase { ID = id });
FreshData();
UpdateData();
}
public void RemoveHomeWork(QuestionBase workInfo)
{
Questions.Remove(workInfo);
FreshData();
UpdateData();
}
public void Append(HomeWork homeWork)
@ -106,7 +107,7 @@ namespace StudentManager.Common
{
Questions.Add(item);
}
UpdateData();
}
}
@ -114,14 +115,14 @@ namespace StudentManager.Common
public class DetailHomeWorkSetInfo
{
public int TotalCount { get; set; } = 0;
public bool Status { get; set; } = false;
public DateTime DateTime { get; set; } = DateTime.Now;
public uint Lesson { get; set; } = 0;
public int TotalCount { get; set; } = 0;
public int ErrorCount { get; set; } = 0;
public int CorrectCount { get; set; } = 0;
public bool Status { get; set; } = false;
public DateTime DateTime { get; set; } = DateTime.Now;
}
@ -129,13 +130,31 @@ namespace StudentManager.Common
{
[JsonInclude]
private Dictionary<uint, HomeWork> HomeWorks { get; set; } = new Dictionary<uint, HomeWork>();
public int TotalCount { get; set; } = 0;
public int TotalSetCount { get; set; } = 0;
public int TotalQuestionCount { get; set; } = 0;
public int TotalErrorQuestionCount { get; set; } = 0;
public int TotalCorrectQuestionCount { get; set; } = 0;
public int TotalErrorQuestionRate { get; set; } = 0;
public void UpdateDate()
{
TotalSetCount = HomeWorks.Count;
TotalQuestionCount = 0;
foreach (var item in HomeWorks)
{
TotalQuestionCount = item.Value.TotalCount;
TotalErrorQuestionCount = item.Value.ErrorCount;
TotalCorrectQuestionCount = item.Value.CorrectCount;
}
TotalErrorQuestionRate = TotalErrorQuestionCount / TotalQuestionCount;
}
public void AddHomeWork(HomeWork homeWork)
{
HomeWorks.Add(homeWork.Lesson, homeWork);
TotalCount = HomeWorks.Count;
UpdateDate();
}
public ObservableCollection<DetailHomeWorkInfo> GetDetailHomeWorkList(uint lesson)
@ -186,6 +205,7 @@ namespace StudentManager.Common
public void RemoveHomeWork(HomeWork homeWork)
{
HomeWorks.Remove(homeWork.Lesson);
UpdateDate();
}
public HomeWork Get(uint cursonId)
@ -196,7 +216,7 @@ namespace StudentManager.Common
public HomeWork GetLast()
{
return HomeWorks[(uint)TotalCount];
return HomeWorks[(uint)TotalSetCount];
}
public List<HomeWork> GetAll()
@ -234,6 +254,8 @@ namespace StudentManager.Common
Status = x.Status == 1
});
});
UpdateDate();
}
}

View File

@ -386,5 +386,54 @@ namespace StudentManager.Common
}
}
}
internal static void UpdateQuestion(QuestionData ques)
{
using (MySqlConnection connection = new MySqlConnection(config))
{
try
{
connection.Open();
string query = @"UPDATE questions SET
problem_type = @Type,
problem_stem = @Stem,
problem_answer = @Answer,
difficulty_level = @DifficultyLevel,
category = @Category,
tags = @Tags,
source = @Source,
lesson = @Lesson,
status = @Status,
update_time = @UpdateTime
WHERE problem_id = @Id";
using (MySqlCommand command = new MySqlCommand(query, connection))
{
command.Parameters.AddWithValue("@Id", ques.Id);
command.Parameters.AddWithValue("@Type", ques.Type.ToString());
command.Parameters.AddWithValue("@Stem", ques.Stem);
command.Parameters.AddWithValue("@Answer", ques.Answer);
command.Parameters.AddWithValue("@DifficultyLevel", ques.DifficultyLevel.ToString());
command.Parameters.AddWithValue("@Category", ques.Category);
command.Parameters.AddWithValue("@Tags", ques.Tags);
command.Parameters.AddWithValue("@Source", ques.Source);
command.Parameters.AddWithValue("@Lesson", ques.Lesson);
command.Parameters.AddWithValue("@Status", ques.Status.ToString());
command.Parameters.AddWithValue("@UpdateTime", ques.UpdateTime);
int rowsAffected = command.ExecuteNonQuery();
Console.WriteLine($"{rowsAffected} rows updated.");
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
finally
{
connection.Close();
}
}
}
}
}

View File

@ -28,7 +28,7 @@ namespace StudentManager.Data
}
public class QuestionData : IDataCommon
public class QuestionData : IDataCommon
{
public int Id { get; set; } = 0;
public QType Type { get; set; } = QType.;

View File

@ -30,13 +30,8 @@ namespace StudentManager.Data
public static Dictionary<int, QuestionData> QuestionDic { get; set; } = new Dictionary<int, QuestionData>();
public static Dictionary<uint, QuestionSetDesc> QuestionTableDesc { get; set; } = new Dictionary<uint, QuestionSetDesc>();
public static Dictionary<uint, Dictionary<int, QuestionData>> QuestionTableDic { get; set; } = new Dictionary<uint, Dictionary<int, QuestionData>>();
public static int TotalCount { get; set; } = 0;
public static int TotalCount { get { return QuestionDic.Count; } }
public static int GetQuestionCount()
{
TotalCount = QuestionDic.Count;
return TotalCount;
}
public static void Load()
{
QuestionDic.Clear();
@ -157,5 +152,13 @@ namespace StudentManager.Data
{
QuestionDic.Remove(id);
}
internal static void Update(QuestionData selectedQuestion)
{
if(QuestionDic[selectedQuestion.Id] != null)
QuestionDic[selectedQuestion.Id] = selectedQuestion;
else
QuestionDic.Add(selectedQuestion.Id, selectedQuestion);
}
}
}

View File

@ -126,7 +126,7 @@ namespace StudentManager.Data
public void PublicHomeWork(uint lesson, bool appendCommonWork = false, bool appendErrorSet = false, int workNum = -1)
{
HomeWork homeWork = new HomeWork();
homeWork.Lesson = (uint)(HomeWorkSet.TotalCount + 1) ;
homeWork.Lesson = (uint)(HomeWorkSet.TotalSetCount + 1) ;
homeWork.DateTime = DateTime.Now;
if(appendErrorSet)
{

View File

@ -4,6 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:StudentManager.Editor"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
@ -38,8 +39,8 @@
</Border.Effect>
<StackPanel Margin="5">
<TextBlock Margin="0,10" Text=" 课程章节序号 "/>
<TextBox Text="{Binding PublicLesson}" MinWidth="50"/>
</StackPanel>
<TextBox Text="{Binding PublicLesson}" MinWidth="50"/>
</StackPanel>
</Border>
<Border Background="#FFFFFF" BorderBrush="Gray" BorderThickness="0" CornerRadius="5" Padding="10" Margin="5">
@ -48,8 +49,8 @@
</Border.Effect>
<StackPanel Margin="5">
<TextBlock Margin="0,10" Text=" 问题数量 "/>
<TextBox Text="{Binding QuestionCount}" MinWidth="50"/>
</StackPanel>
<TextBox Text="{Binding QuestionCount}" MinWidth="50"/>
</StackPanel>
</Border>
</StackPanel>
@ -70,16 +71,14 @@
<Border.Effect>
<DropShadowEffect Color="#FFF5F5F5" BlurRadius="10" ShadowDepth="1" Direction="0"/>
</Border.Effect>
<Border.Style>
<Style TargetType="Border">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Black"/>
<Setter Property="BorderBrush" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</Border.Style>
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseEnter">
<i:ChangePropertyAction PropertyName="Background" Value="#FFFEFEFE"/>
</i:EventTrigger>
<i:EventTrigger EventName="MouseLeave">
<i:ChangePropertyAction PropertyName="Background" Value="#FFF9F9F9"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<StackPanel>
<TextBlock TextWrapping="Wrap" FontSize="12" FontWeight="Bold" Text="{Binding Type}"
VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,10"/>

View File

@ -11,6 +11,55 @@
<Style x:Key="TextStyle" TargetType="TextBlock">
<Setter Property="Width" Value="200"/>
</Style>
<Style x:Key="ModernMenuItemStyle" TargetType="MenuItem">
<Setter Property="Background" Value="White"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="Padding" Value="10,5"/>
<Setter Property="Margin" Value="20,10"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="MenuItem">
<Border Background="{TemplateBinding Background}" HorizontalAlignment="Stretch" CornerRadius="5" Height="20" Width="50">
<Grid>
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" ContentSource="Header"/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="DarkGray"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- 定义 ContextMenu 的样式 -->
<Style x:Key="ModernContextMenuStyle" TargetType="ContextMenu">
<Setter Property="Background" Value="White"/>
<Setter Property="BorderBrush" Value="#FF007ACC"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ContextMenu">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="10">
<StackPanel>
<ItemsPresenter/>
</StackPanel>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<ContextMenu x:Key="MyModernContextMenu" Style="{StaticResource ModernContextMenuStyle}">
<MenuItem Header="查看详情" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" Command="{Binding DataContext.RegionTo, RelativeSource={RelativeSource AncestorType=UserControl}}" CommandParameter="DetailCheckView" Style="{StaticResource ModernMenuItemStyle}"/>
<MenuItem Header="删除" Command="{Binding Option2Command}" Style="{StaticResource ModernMenuItemStyle}"/>
</ContextMenu>
</UserControl.Resources>
<Grid Background="Transparent">
@ -20,24 +69,21 @@
</Grid.ColumnDefinitions>
<Border CornerRadius="20"/>
<ListBox ItemsSource="{Binding StudentDatas}" Margin="10"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
SelectedItem="{Binding SelectedStudent}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction
CommandParameter="{Binding SelectedItem, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
Command="{Binding DataContext.SelectedCommand ,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<ListBox.Style>
<ListBox ItemsSource="{Binding StudentDatas}" ScrollViewer.VerticalScrollBarVisibility="Disabled" BorderThickness="0"
SelectedItem="{Binding SelectedStudent}">
<ListBox.Resources>
<Style TargetType="ListBox">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBox">
<Border BorderBrush="Transparent" BorderThickness="1" CornerRadius="10" Background="#FFEEEEEE">
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="10">
<Border.Effect>
<DropShadowEffect Color="#FFF5F5F5" BlurRadius="10" ShadowDepth="1" Direction="0"/>
</Border.Effect>
<ScrollViewer Margin="0" Focusable="false">
<ItemsPresenter/>
</ScrollViewer>
</Border>
@ -45,84 +91,159 @@
</Setter.Value>
</Setter>
</Style>
</ListBox.Style>
<Style TargetType="ListBoxItem">
<Setter Property="Background" Value="White"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="Padding" Value="10"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1"
CornerRadius="5">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#FF007ACC"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#FFBEE6FD"/>
<Setter Property="BorderBrush" Value="#FF3C7FB1"/>
</Trigger>
</Style.Triggers>
</Style>
</ListBox.Resources>
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction
CommandParameter="{Binding SelectedItem, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
Command="{Binding DataContext.SelectedCommand ,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5"/>
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Grid Grid.Column="1">
<ListView ItemsSource="{Binding HomeWorkSet}" Foreground="Black"
Margin="10"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.Style>
<Style TargetType="ListView">
<Setter Property="Background" Value="LightGray"/>
<Setter Property="BorderBrush" Value="Black"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListView">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="5">
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<ItemsPresenter/>
</ScrollViewer>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListView.Style>
<Border Grid.Column="1">
<ScrollViewer Grid.Column="0" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden" Margin="0">
<ItemsControl ItemsSource="{Binding HomeWorkSet}" HorizontalAlignment="Left">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Background="#FFF9F9F9" BorderBrush="Gray" BorderThickness="0" CornerRadius="10" Margin="5" MouseRightButtonUp="Border_MouseRightButtonUp"
Padding="5" Height="240" Width="140" IsHitTestVisible="True">
<Border.Effect>
<DropShadowEffect Color="#FFF5F5F5" BlurRadius="10" ShadowDepth="1" Direction="0"/>
</Border.Effect>
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseEnter">
<i:ChangePropertyAction PropertyName="Background" Value="#FFFEFEFE"/>
</i:EventTrigger>
<i:EventTrigger EventName="MouseLeave">
<i:ChangePropertyAction PropertyName="Background" Value="#FFF9F9F9"/>
</i:EventTrigger>
<i:EventTrigger EventName="MouseRightButtonDown">
<i:InvokeCommandAction Command="{Binding DataContext.HomeWorkSetSelectedCommand ,RelativeSource={RelativeSource AncestorType=UserControl}}" CommandParameter="{Binding }"/>
</i:EventTrigger>
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDoubleClick">
<i:InvokeCommandAction
CommandParameter="DetailCheckView"
Command="{Binding DataContext.RegionTo ,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"/>
</i:EventTrigger>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction
CommandParameter="{Binding SelectedItem, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
Command="{Binding DataContext.HomeWorkSetSelectedCommand ,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</i:Interaction.Triggers>
<ListView.View>
<GridView>
<GridViewColumn
DisplayMemberBinding="{Binding DateTime}"
Header="创建时间"/>
<GridViewColumn
DisplayMemberBinding="{Binding Lesson}"
Header="第几课" />
<GridViewColumn
DisplayMemberBinding="{Binding TotalCount}"
Header="总题数" />
<GridViewColumn
DisplayMemberBinding="{Binding ErrorCount}"
Header="总错误题数" />
<GridViewColumn
DisplayMemberBinding="{Binding CorrectCount}"
Header="总正确题数" />
<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<Button Content="删除" Command="{Binding DeleteSelectedHomeworkCommand}"
CommandParameter="{Binding}"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
<DockPanel LastChildFill="False">
<StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
</Grid>
<TextBlock TextWrapping="Wrap" FontSize="12" FontWeight="Bold" Text="Lesson:"
VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,10"/>
<TextBlock TextWrapping="Wrap" FontSize="12" FontWeight="Bold" Text="{Binding Lesson}"
VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,10"/>
</StackPanel>
<Border DockPanel.Dock="Top" BorderBrush="Gray" BorderThickness="0,0.5,0,0" Margin="5,0,5,10"/>
<Grid DockPanel.Dock="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical">
<TextBlock TextWrapping="Wrap" FontSize="12" Text="总题数" Margin="5" Foreground="Gray"
VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBlock TextWrapping="Wrap" FontSize="18" Margin="5"
Text="{Binding TotalCount}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Grid.Column="1" Orientation="Vertical">
<TextBlock TextWrapping="Wrap" FontSize="12" Text="总错误数" Margin="5" Foreground="Gray"
VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBlock TextWrapping="Wrap" FontSize="18" Margin="5"
Text="{Binding ErrorCount}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
</StackPanel>
</Grid>
<Border DockPanel.Dock="Top" BorderBrush="Gray" BorderThickness="0,0.5,0,0" Margin="5,0,5,10"/>
<Grid DockPanel.Dock="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical">
<TextBlock TextWrapping="Wrap" FontSize="12" Text="错误率" Margin="5" Foreground="Gray"
VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBlock TextWrapping="Wrap" FontSize="18" Margin="5"
Text="{Binding TotalCount}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Grid.Column="1" Orientation="Vertical">
<TextBlock TextWrapping="Wrap" FontSize="12" Text="总正确数" Margin="5" Foreground="Gray"
VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBlock TextWrapping="Wrap" FontSize="18" Margin="5"
Text="{Binding ErrorCount}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
</StackPanel>
</Grid>
<StackPanel Orientation="Horizontal" DockPanel.Dock="Bottom">
<StackPanel.Resources>
<Style TargetType="Border">
<Style.Triggers>
<DataTrigger Binding="{Binding Status}" Value="true">
<Setter Property="Background" Value="Green"/>
</DataTrigger>
<DataTrigger Binding="{Binding Status}" Value="false">
<Setter Property="Background" Value="Red"/>
</DataTrigger>
</Style.Triggers>
</Style>
</StackPanel.Resources>
<TextBlock TextWrapping="Wrap" FontSize="8" Margin="0,2" FontWeight="Bold"
Text="{Binding DateTime}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<Border Height="10" Width="10" Margin="10,0" CornerRadius="20"/>
</StackPanel>
</DockPanel>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Border>
</Grid>
</UserControl>

View File

@ -30,5 +30,20 @@ namespace StudentManager.Editor
{
}
private void Border_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
{
if (e.OriginalSource is FrameworkElement element)
{
var contextMenu = element.FindResource("MyModernContextMenu") as ContextMenu;
if (contextMenu != null)
{
contextMenu.PlacementTarget = element;
contextMenu.Placement = System.Windows.Controls.Primitives.PlacementMode.MousePoint;
contextMenu.Style = (Style)element.FindResource("ModernContextMenuStyle");
contextMenu.IsOpen = true;
}
}
}
}
}

View File

@ -15,53 +15,119 @@
<Grid>
<DockPanel HorizontalAlignment="Stretch">
<ListBox ItemsSource="{Binding HomeWorkSet}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ListBox ItemsSource="{Binding HomeWorkSet}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction
CommandParameter="{Binding SelectedItem, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
Command="{Binding DataContext.HomeWorkSetSelectedCommand ,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Lesson}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</i:EventTrigger>
</i:Interaction.Triggers>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Lesson}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<DockPanel LastChildFill="False" HorizontalAlignment="Stretch">
<!--<DockPanel LastChildFill="False" HorizontalAlignment="Stretch">
<ListView DockPanel.Dock="Top" ItemsSource="{Binding HomeWork}">
<ListView.View>
<GridView>
<GridViewColumn
-->
<!--<ListView DockPanel.Dock="Top" ItemsSource="{Binding HomeWork}">
<ListView.View>
<GridView>
<GridViewColumn
DisplayMemberBinding="{Binding QuestionData.Id}"
Header="ID" />
<GridViewColumn
<GridViewColumn
DisplayMemberBinding="{Binding QuestionData.Stem}"
Header="题干" />
<GridViewColumn Header="正确?">
<GridViewColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding Status}"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
<GridViewColumn Header="正确?">
<GridViewColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding Status}"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>-->
<!--<DataGrid DockPanel.Dock="Top" ItemsSource="{Binding HomeWork}" CanUserAddRows="False" CanUserDeleteRows="False" >
--><!--<DataGrid.Columns>
<!--<DataGrid DockPanel.Dock="Top" ItemsSource="{Binding HomeWork}" CanUserAddRows="False" CanUserDeleteRows="False" >
-->
<!--<DataGrid.Columns>
<DataGridCheckBoxColumn Header="正确?" Binding="{Binding Status}" />
</DataGrid.Columns>--><!--
</DataGrid.Columns>-->
<!--
</DataGrid>-->
<!--
<Button DockPanel.Dock="Bottom" MinHeight=" 50" Content="提交" Command="{Binding SubmitHomeWorkCommand}"/>
</DockPanel>
</DockPanel>
</DockPanel>-->
<Grid Grid.Column="1" >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<ScrollViewer DockPanel.Dock="Top" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden" Margin="0">
<ItemsControl ItemsSource="{Binding HomeWork}" HorizontalAlignment="Left">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderBrush="Gray" BorderThickness="0" CornerRadius="10" Margin="5"
Padding="5" Height="150" Width="120" IsHitTestVisible="True">
<Border.Effect>
<DropShadowEffect Color="#FFF5F5F5" BlurRadius="10" ShadowDepth="1" Direction="0"/>
</Border.Effect>
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseEnter">
<i:ChangePropertyAction PropertyName="Background" Value="#FFFEFEFE"/>
</i:EventTrigger>
<i:EventTrigger EventName="MouseLeave">
<i:ChangePropertyAction PropertyName="Background" Value="#FFF9F9F9"/>
</i:EventTrigger>
<!--<i:EventTrigger EventName="MouseLeftButtonUp">
<i:InvokeCommandAction Command="{Binding DataContext.HomeWorkSelectedCommand ,RelativeSource={RelativeSource AncestorType=UserControl}}" CommandParameter="{Binding }"/>
</i:EventTrigger>-->
</i:Interaction.Triggers>
<Grid>
<StackPanel>
<TextBlock TextWrapping="Wrap" FontSize="12" FontWeight="Bold" Text="{Binding QuestionData.Type}"
VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,10"/>
<Border BorderBrush="Gray" BorderThickness="0,0.5,0,0" Margin="5,0,5,10"/>
<StackPanel Orientation="Vertical">
<TextBlock TextWrapping="Wrap" FontSize="12" Margin="5" Height="60"
Text="{Binding QuestionData.Stem}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
</StackPanel>
</StackPanel>
<CheckBox IsChecked="{Binding Status}" Padding="200,0" HorizontalAlignment="Stretch" VerticalContentAlignment="Bottom" VerticalAlignment="Stretch"/>
</Grid>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<Button Grid.Row="1" MinHeight=" 50" Content="提交" Command="{Binding SubmitHomeWorkCommand}" Style="{DynamicResource MaterialDesignFlatDarkButton}"/>
</Grid>
</Grid>
</UserControl>

View File

@ -9,11 +9,11 @@
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<Style x:Key="TextStyle" TargetType="{x:Type TextBlock}">
<!--<Style x:Key="TextStyle" TargetType="{x:Type TextBlock}">
<Setter Property="Margin" Value="10,5"/>
<Setter Property="Width" Value="50"/>
<Setter Property="Foreground" Value="White"/>
</Style>
</Style>-->
</UserControl.Resources>
<Grid>
@ -23,8 +23,56 @@
</Grid.ColumnDefinitions>
<ListBox ItemsSource="{Binding StudentDatas}" ScrollViewer.VerticalScrollBarVisibility="Disabled"
<ListBox ItemsSource="{Binding StudentDatas}" ScrollViewer.VerticalScrollBarVisibility="Disabled" BorderThickness="0"
SelectedItem="{Binding SelectedStudent}">
<ListBox.Resources>
<Style TargetType="ListBox">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBox">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="10">
<Border.Effect>
<DropShadowEffect Color="#FFF5F5F5" BlurRadius="10" ShadowDepth="1" Direction="0"/>
</Border.Effect>
<ScrollViewer Margin="0" Focusable="false">
<ItemsPresenter/>
</ScrollViewer>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ListBoxItem">
<Setter Property="Background" Value="White"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="Padding" Value="10"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1"
CornerRadius="5">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#FF007ACC"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#FFBEE6FD"/>
<Setter Property="BorderBrush" Value="#FF3C7FB1"/>
</Trigger>
</Style.Triggers>
</Style>
</ListBox.Resources>
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction
@ -32,6 +80,7 @@
Command="{Binding DataContext.SelectedCommand ,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"/>
@ -39,82 +88,175 @@
</ListBox.ItemTemplate>
</ListBox>
<Grid Grid.Column="1">
<Grid Grid.Column="1" Margin="0" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition Height="0.3*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<Border Background="Transparent" Margin="5" Grid.RowSpan="2" Grid.ColumnSpan="2" CornerRadius="10"/>
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextStyle}" Text="姓名"/>
<TextBlock Style="{StaticResource TextStyle}" Text="正确数"/>
<TextBlock Style="{StaticResource TextStyle}" Text="第几课"/>
<TextBlock Style="{StaticResource TextStyle}" Text="状态"/>
</StackPanel>
<Border Grid.Row="0" Background="#FF0069FE" CornerRadius="10" Margin="10">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<StackPanel Margin="30">
<TextBlock Text="{Binding SelectedStudent.Name}" FontWeight="Black" FontSize="22" Foreground="White"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="性别:" Foreground="LightGoldenrodYellow" HorizontalAlignment="Left" FontSize="14" Margin="5" />
<TextBlock Text="{Binding SelectedStudent.Gender}" Foreground="LightGoldenrodYellow" HorizontalAlignment="Left" FontSize="14" Margin="5" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="年级:" Foreground="LightGoldenrodYellow" HorizontalAlignment="Left" FontSize="14" Margin="5" />
<TextBlock Text="{Binding SelectedStudent.Grade}" Foreground="LightGoldenrodYellow" HorizontalAlignment="Left" FontSize="14" Margin="5" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="地址:" Foreground="LightGray" HorizontalAlignment="Left" FontSize="8" Margin="5,2" />
<TextBlock Text="{Binding SelectedStudent.Address}" Width="350" Foreground="LightGray" HorizontalAlignment="Left" FontSize="8" Margin="5,2" TextWrapping="Wrap"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="联系方式:" Foreground="LightGray" HorizontalAlignment="Left" FontSize="8" Margin="5,2" />
<TextBlock Text="{Binding SelectedStudent.Contact}" Foreground="LightGray" HorizontalAlignment="Left" FontSize="8" Margin="5,2" />
</StackPanel>
</StackPanel>
<StackPanel Grid.Row="1">
<StackPanel Margin="30" Grid.Column="1">
<TextBlock Text="DETAIL" FontWeight="Black" FontSize="22" Foreground="White"/>
<TextBlock Text="{Binding SelectedStudent.Address}" Width="350" Foreground="LightGoldenrodYellow" HorizontalAlignment="Left" FontSize="14" Margin="5" TextWrapping="Wrap"/>
<TextBlock Text="{Binding SelectedStudent.Gender}" TextWrapping="Wrap" FontSize="8" Margin="5,20" Foreground="LightGray"/>
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextStyle}" Text="总题数量"/>
<TextBlock Style="{StaticResource TextStyle}" Text="总错题数量"/>
<TextBlock Style="{StaticResource TextStyle}" Text="修正数量"/>
<TextBlock Style="{StaticResource TextStyle}" Text="错误数量"/>
<TextBlock Style="{StaticResource TextStyle}" Text="错误率"/>
<TextBlock Style="{StaticResource TextStyle}" Text="修正率"/>
</StackPanel>
</StackPanel>
</Grid>
</Border>
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextStyle}" Text="{Binding ErrorSet.TotalCount}"/>
<TextBlock Style="{StaticResource TextStyle}" Text="{Binding ErrorSet.TotalErrorCount}"/>
<TextBlock Style="{StaticResource TextStyle}" Text="{Binding ErrorSet.CorrectCount}"/>
<TextBlock Style="{StaticResource TextStyle}" Text="{Binding ErrorSet.ErrorCount}"/>
<TextBlock Style="{StaticResource TextStyle}" Text="{Binding ErrorSet.ErrorRate}"/>
<TextBlock Style="{StaticResource TextStyle}" Text="{Binding ErrorSet.CorrectRate}"/>
<Grid Grid.Row="1">
<Border Background="#FF666666" Margin="5" Grid.RowSpan="2" Grid.ColumnSpan="2" CornerRadius="10"/>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
</StackPanel>
</Grid>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="1" Background="Transparent">
<ScrollViewer Grid.Column="1" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden" Margin="10">
<ItemsControl Grid.Row="1" ItemsSource="{Binding ErrorSetDatas}" HorizontalAlignment="Left">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Background="#FFFEFEFE" BorderBrush="Gray" BorderThickness="0" CornerRadius="10"
Padding="5" Height="200" Width="120" Margin="5" IsHitTestVisible="True" MouseRightButtonDown="Border_MouseRightButtonDown">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseEnter">
<i:ChangePropertyAction PropertyName="Background" Value="#FFFEFEFE"/>
</i:EventTrigger>
<i:EventTrigger EventName="MouseLeave">
<i:ChangePropertyAction PropertyName="Background" Value="#FFF9F9F9"/>
</i:EventTrigger>
<i:EventTrigger EventName="MouseRightButtonDown">
<i:InvokeCommandAction Command="{Binding DataContext.SelectedCommand, RelativeSource={RelativeSource AncestorType=UserControl}}" CommandParameter="{Binding}"/>
</i:EventTrigger>
<!--<i:EventTrigger EventName="MouseRightButtonDown">
<i:InvokeCommandAction Command="{Binding DataContext.ShowContextMenuCommand, RelativeSource={RelativeSource AncestorType=UserControl}}" CommandParameter="{Binding}"/>
</i:EventTrigger>-->
</i:Interaction.Triggers>
<Border.Effect>
<DropShadowEffect Color="#FFF5F5F5" BlurRadius="10" ShadowDepth="1" Direction="0"/>
</Border.Effect>
<StackPanel>
<TextBlock TextWrapping="Wrap" FontSize="12" FontWeight="Bold" Text="{Binding QuestionData.Stem}" Height="60"
VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,10"/>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical">
<TextBlock TextWrapping="Wrap" FontSize="12" Text="使用数" Margin="5" Foreground="Gray"
VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBlock TextWrapping="Wrap" FontSize="18" Margin="5"
Text="{Binding TotalUseCount}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Grid.Column="1" Orientation="Vertical">
<TextBlock TextWrapping="Wrap" FontSize="12" Text="错误数" Margin="5" Foreground="Gray"
VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBlock TextWrapping="Wrap" FontSize="18" Margin="5"
Text="{Binding ErrorCount}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
</StackPanel>
</Grid>
</StackPanel>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical">
<TextBlock TextWrapping="Wrap" FontSize="12" Text="状态" Margin="5" Foreground="Gray"
VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBlock TextWrapping="Wrap" FontSize="18" Margin="5"
Text="{Binding TotalUseCount}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Grid.Row="2">
<StackPanel Grid.Column="1" Orientation="Vertical">
<TextBlock TextWrapping="Wrap" FontSize="12" Text="正确数" Margin="5" Foreground="Gray"
VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBlock TextWrapping="Wrap" FontSize="18" Margin="5"
Text="{Binding ErrorCount}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
</StackPanel>
</Grid>
</StackPanel>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Border>
<Border Grid.Column="0" Background="Gray" Margin="10" CornerRadius="10">
<Border.Effect>
<DropShadowEffect Color="#FFF5F5F5" BlurRadius="10" ShadowDepth="1" Direction="0"/>
</Border.Effect>
<DataGrid ItemsSource="{Binding HomeWorkSet}" ScrollViewer.HorizontalScrollBarVisibility="Auto" IsReadOnly="True">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridRow">
<Border CornerRadius="10" Margin="5" Background="White">
<Border.Effect>
<DropShadowEffect Color="#FFF5F5F5" BlurRadius="10" ShadowDepth="1" Direction="0"/>
</Border.Effect>
<DataGridCellsPresenter/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</DataGrid.RowStyle>
</DataGrid>
</Border>
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextStyle}" Text="第几课"/>
<TextBlock Style="{StaticResource TextStyle}" Text="总数"/>
<TextBlock Style="{StaticResource TextStyle}" Text="正确数"/>
<TextBlock Style="{StaticResource TextStyle}" Text="状态"/>
</StackPanel>
</Grid>
<ListBox ItemsSource="{Binding HomeWorkSet}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDoubleClick">
<i:InvokeCommandAction
CommandParameter="DetailCheckView"
Command="{Binding DataContext.RegionTo ,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"/>
</i:EventTrigger>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction
CommandParameter="{Binding SelectedItem, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
Command="{Binding DataContext.HomeWorkSetSelectedCommand ,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextStyle}" Text="{Binding Lesson}"/>
<TextBlock Style="{StaticResource TextStyle}" Text="{Binding TotalCount}"/>
<TextBlock Style="{StaticResource TextStyle}" Text="{Binding CorrectCount}"/>
<TextBlock Style="{StaticResource TextStyle}" Text="{Binding Status}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
</Grid>
</Grid>
</UserControl>

View File

@ -30,5 +30,10 @@ namespace StudentManager.Editor
{
}
}
private void Border_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
}
}
}

View File

@ -45,8 +45,11 @@
Command="{Binding SaveAllCommand}"/>
<Button Margin="5" HorizontalAlignment="Stretch" DockPanel.Dock="Bottom" Content="刷新数据" Style="{DynamicResource MaterialDesignFlatDarkButton}"
Command="{Binding FreshAllCommand}"/>
</DockPanel>
<Border BorderBrush="Gray" BorderThickness="1,0,0,0" Margin="2,50" Grid.Column="1"/>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="100"/>

View File

@ -15,34 +15,185 @@
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.4*"/>
<RowDefinition Height="0.0*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0">
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.7*"/>
<ColumnDefinition Width="0.22*"/>
</Grid.ColumnDefinitions>
<Border Background="Gray" CornerRadius="10" Margin="10" Height="20" />
<Border Background="Gray" CornerRadius="10" Margin="10"/>
</StackPanel>
<ScrollViewer Grid.Column="0" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden" Margin="0">
<ItemsControl ItemsSource="{Binding QuestionDatas}" HorizontalAlignment="Left">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Background="#FFF9F9F9" BorderBrush="Gray" BorderThickness="0" CornerRadius="10" Margin="5"
Padding="5" Height="150" Width="120" IsHitTestVisible="True">
<Border.Effect>
<DropShadowEffect Color="#FFF5F5F5" BlurRadius="10" ShadowDepth="1" Direction="0"/>
</Border.Effect>
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseEnter">
<i:ChangePropertyAction PropertyName="Background" Value="#FFFEFEFE"/>
</i:EventTrigger>
<i:EventTrigger EventName="MouseLeave">
<i:ChangePropertyAction PropertyName="Background" Value="#FFF9F9F9"/>
</i:EventTrigger>
<i:EventTrigger EventName="MouseLeftButtonUp">
<i:InvokeCommandAction Command="{Binding DataContext.SelectedQuestionChangedCommand ,RelativeSource={RelativeSource AncestorType=UserControl}}" CommandParameter="{Binding }"/>
</i:EventTrigger>
<DataGrid ItemsSource="{Binding QuestionDatas}" Background="#22aaaaaa" Grid.Row="1"
ScrollViewer.HorizontalScrollBarVisibility="Disabled" CanUserDeleteRows="False" CanUserAddRows="False"
IsReadOnly="True" Foreground="#FF222222"
ScrollViewer.VerticalScrollBarVisibility="Disabled">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridRow">
<Border CornerRadius="10" Margin="5" Background="White">
<DataGridCellsPresenter/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</DataGrid.RowStyle>
</DataGrid>
</i:Interaction.Triggers>
<StackPanel>
<TextBlock TextWrapping="Wrap" FontSize="12" FontWeight="Bold" Text="{Binding Type}"
VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,10"/>
<Border BorderBrush="Gray" BorderThickness="0,0.5,0,0" Margin="5,0,5,10"/>
<StackPanel Orientation="Vertical">
<TextBlock TextWrapping="Wrap" FontSize="12" Text="题干" Foreground="Gray" Margin="5,5"
VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBlock TextWrapping="Wrap" FontSize="12" Margin="5"
Text="{Binding Stem}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
</StackPanel>
</StackPanel>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<Border Background="#FFF5F5F5" Grid.Column="1" CornerRadius="10" Padding="10">
<Border.Effect>
<DropShadowEffect Color="#FFA5A5A5" BlurRadius="10" ShadowDepth="5" />
</Border.Effect>
<DockPanel LastChildFill="False">
<StackPanel DockPanel.Dock="Top">
<StackPanel.Resources>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="Margin" Value="10"/>
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>
</StackPanel.Resources>
<TextBlock Text="DETAIL DIALOG" FontSize="20" FontWeight="Bold" />
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<StackPanel>
<TextBlock Text="{Binding SelectedQuestion.Type, Mode=TwoWay}" FontSize="22" FontWeight="Bold"/>
</StackPanel>
<StackPanel Grid.Column="1" Margin="0,0">
<TextBlock Text="课文" Foreground="Gray"/>
<TextBox Text="{Binding SelectedQuestion.Lesson, Mode=TwoWay}" DockPanel.Dock="Right"/>
</StackPanel>
</Grid>
<Border BorderBrush="Gray" BorderThickness="0,0.5,0,0" Margin="5,0,5,10"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<StackPanel>
<TextBlock Text="题干" Foreground="Gray"/>
<TextBox Text="{Binding SelectedQuestion.Stem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" TextWrapping="Wrap"/>
</StackPanel>
<StackPanel Grid.Column="1" Margin="0,0">
<TextBlock Text="答案:" Foreground="Gray"/>
<TextBox Text="{Binding SelectedQuestion.Answer, Mode=TwoWay}" TextWrapping="Wrap"/>
</StackPanel>
</Grid>
<Border BorderBrush="Gray" BorderThickness="0,0.5,0,0" Margin="5,0,5,10"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<StackPanel>
<TextBlock Text="Category:" Foreground="Gray"/>
<TextBox Text="{Binding SelectedQuestion.Category, Mode=TwoWay}" TextWrapping="Wrap"/>
</StackPanel>
<StackPanel Grid.Column="1" Margin="0,0">
<TextBlock Text="难度:" Foreground="Gray"/>
<TextBlock Text="{Binding SelectedQuestion.DifficultyLevel, Mode=TwoWay}" />
</StackPanel>
</Grid>
<Border BorderBrush="Gray" BorderThickness="0,0.5,0,0" Margin="5,0,5,10"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<StackPanel>
<TextBlock Text="Tags:" Foreground="Gray"/>
<TextBox Text="{Binding SelectedQuestion.Tags, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" TextWrapping="Wrap"/>
</StackPanel>
<StackPanel Grid.Column="1" Margin="0,0">
<TextBlock Text="Source:" Foreground="Gray"/>
<TextBox Text="{Binding SelectedQuestion.Source, Mode=TwoWay}" TextWrapping="Wrap"/>
</StackPanel>
</Grid>
<Border BorderBrush="Gray" BorderThickness="0,0.5,0,0" Margin="5,0,5,10"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<StackPanel>
<TextBlock Text="Status:" Foreground="Gray"/>
<TextBlock Text="{Binding SelectedQuestion.Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
<StackPanel Grid.Column="1" Margin="0,0">
<TextBlock Text="Update Time:" Foreground="Gray"/>
<TextBlock Text="{Binding SelectedQuestion.UpdateTime, Mode=TwoWay}" />
</StackPanel>
</Grid>
<Border BorderBrush="Gray" BorderThickness="0,0.5,0,0" Margin="5,0,5,10"/>
</StackPanel>
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="0,0">
<Button Content="修改" HorizontalAlignment="Center" Command="{Binding UpdateQuestionCommand}" Style="{DynamicResource MaterialDesignFlatDarkButton}"/>
<Button Content="删除" HorizontalAlignment="Center" Command="{Binding DeleteQuestionCommand}" Style="{DynamicResource MaterialDesignFlatDarkButton}"/>
</StackPanel>
</DockPanel>
</Border>
</Grid>
</Grid>
</UserControl>

View File

@ -12,6 +12,55 @@
<Setter Property="Margin" Value="10,5"/>
<Setter Property="Width" Value="50"/>
</Style>
<Style x:Key="ModernMenuItemStyle" TargetType="MenuItem">
<Setter Property="Background" Value="White"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="Padding" Value="10,5"/>
<Setter Property="Margin" Value="20,10"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="MenuItem">
<Border Background="{TemplateBinding Background}" HorizontalAlignment="Stretch" CornerRadius="5" Height="20" Width="50">
<Grid>
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" ContentSource="Header"/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="DarkGray"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- 定义 ContextMenu 的样式 -->
<Style x:Key="ModernContextMenuStyle" TargetType="ContextMenu">
<Setter Property="Background" Value="White"/>
<Setter Property="BorderBrush" Value="#FF007ACC"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ContextMenu">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="10">
<StackPanel>
<ItemsPresenter/>
</StackPanel>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<ContextMenu x:Key="MyModernContextMenu" Style="{StaticResource ModernContextMenuStyle}">
<MenuItem Header="查看详情" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" Command="{Binding DataContext.RegionTo, RelativeSource={RelativeSource AncestorType=UserControl}}" CommandParameter="DetailView" Style="{StaticResource ModernMenuItemStyle}"/>
<MenuItem Header="删除" Command="{Binding Option2Command}" Style="{StaticResource ModernMenuItemStyle}"/>
</ContextMenu>
</UserControl.Resources>
<Grid Background="Transparent">
<Border Background="#FFFAFAFA" CornerRadius="10"/>
@ -26,39 +75,59 @@
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Background="#FFFEFEFE" BorderBrush="Gray" BorderThickness="0" CornerRadius="10"
Padding="5" Height="200" Width="120" Margin="5" IsHitTestVisible="True">
Padding="5" Height="200" Width="120" Margin="5" IsHitTestVisible="True" MouseRightButtonDown="Border_MouseRightButtonDown">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseEnter">
<i:ChangePropertyAction PropertyName="Background" Value="#FFFEFEFE"/>
</i:EventTrigger>
<i:EventTrigger EventName="MouseLeave">
<i:ChangePropertyAction PropertyName="Background" Value="#FFF9F9F9"/>
</i:EventTrigger>
<i:EventTrigger EventName="MouseRightButtonDown">
<i:InvokeCommandAction Command="{Binding DataContext.SelectedCommand, RelativeSource={RelativeSource AncestorType=UserControl}}" CommandParameter="{Binding}"/>
</i:EventTrigger>
<!--<i:EventTrigger EventName="MouseRightButtonDown">
<i:InvokeCommandAction Command="{Binding DataContext.ShowContextMenuCommand, RelativeSource={RelativeSource AncestorType=UserControl}}" CommandParameter="{Binding}"/>
</i:EventTrigger>-->
</i:Interaction.Triggers>
<Border.Effect>
<DropShadowEffect Color="#FFF5F5F5" BlurRadius="10" ShadowDepth="1" Direction="0"/>
</Border.Effect>
<Border.Style>
<Style TargetType="Border">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Black"/>
<Setter Property="BorderBrush" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</Border.Style>
<StackPanel>
<TextBlock TextWrapping="Wrap" FontSize="20" FontWeight="Bold" Text="{Binding Name}"
VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,10"/>
<StackPanel Orientation="Vertical">
<TextBlock TextWrapping="Wrap" FontSize="12" Text="总数" Margin="5" Foreground="Gray"
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical">
<TextBlock TextWrapping="Wrap" FontSize="12" Text="总数" Margin="5" Foreground="Gray"
VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBlock TextWrapping="Wrap" FontSize="18" Margin="5"
<TextBlock TextWrapping="Wrap" FontSize="18" Margin="5"
Text="{Binding ErrorSet.TotalCount}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Vertical">
<TextBlock TextWrapping="Wrap" FontSize="12" Text="总数" Margin="5" Foreground="Gray"
VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBlock TextWrapping="Wrap" FontSize="18" Margin="5"
Text="{Binding ErrorSet.TotalCount}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
</StackPanel>
</StackPanel>
<Border BorderBrush="Gray" BorderThickness="0,0.5,0,0" Margin="5"/>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Vertical">
<TextBlock TextWrapping="Wrap" FontSize="12" Text="正确数" Margin="5" Foreground="Gray"
VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBlock TextWrapping="Wrap" FontSize="18" Text="{Binding ErrorSet.CorrectCount}" Margin="5"
VerticalAlignment="Center" HorizontalAlignment="Left"/>
</StackPanel>
<TextBlock TextWrapping="Wrap" FontSize="12" Text="正确数" Margin="5" Foreground="Gray"
<StackPanel Orientation="Vertical">
<TextBlock TextWrapping="Wrap" FontSize="12" Text="正确数" Margin="5" Foreground="Gray"
VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBlock TextWrapping="Wrap" FontSize="18" Text="{Binding ErrorSet.CorrectCount}" Margin="5"
<TextBlock TextWrapping="Wrap" FontSize="18" Text="{Binding ErrorSet.CorrectCount}" Margin="5"
VerticalAlignment="Center" HorizontalAlignment="Left"/>
</StackPanel>
</StackPanel>
</StackPanel>
</Border>

View File

@ -30,5 +30,20 @@ namespace StudentManager.Editor
{
var data = DataContext;
}
}
private void Border_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.OriginalSource is FrameworkElement element)
{
var contextMenu = element.FindResource("MyModernContextMenu") as ContextMenu;
if (contextMenu != null)
{
contextMenu.PlacementTarget = element;
contextMenu.Placement = System.Windows.Controls.Primitives.PlacementMode.MousePoint;
contextMenu.Style = (Style)element.FindResource("ModernContextMenuStyle");
contextMenu.IsOpen = true;
}
}
}
}
}

View File

@ -1,4 +1,5 @@
using Mysqlx.Crud;
using DryIoc.ImTools;
using Mysqlx.Crud;
using Newtonsoft.Json;
using Org.BouncyCastle.Utilities;
using StudentManager.Common;
@ -13,6 +14,8 @@ using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace StudentManager.Model
{
@ -65,7 +68,7 @@ namespace StudentManager.Model
public ObservableCollection<QuestionData> ADDQuestionDatas { get { return addQuestionDatas; } private set { addQuestionDatas = value; RaisePropertyChanged(); } }
private ObservableCollection<DetailErrorInfo> errorSetDatas = new ObservableCollection<DetailErrorInfo>();
public ReadOnlyObservableCollection<DetailErrorInfo> ErrorSetDatas { get; private set; }
public ObservableCollection<DetailErrorInfo> ErrorSetDatas { get { return errorSetDatas; } private set { errorSetDatas = value; RaisePropertyChanged(); } }
private ObservableCollection<CursonQuestionsData> cQDatas = new ObservableCollection<CursonQuestionsData>();
public ReadOnlyObservableCollection<CursonQuestionsData> CQDatas { get; private set; }
@ -180,6 +183,13 @@ namespace StudentManager.Model
set { questionCount = value; RaisePropertyChanged(); }
}
private QuestionData selectedQuestion = new QuestionData();
public QuestionData SelectedQuestion
{
get { return selectedQuestion; }
set { selectedQuestion = value; RaisePropertyChanged(); }
}
@ -190,8 +200,11 @@ namespace StudentManager.Model
public DelegateCommand<StudentInfo> SelectedCommand { get; set; }
public DelegateCommand<DetailHomeWorkInfo> HomeWorkSelectedCommand { get; set; }
public DelegateCommand<DetailHomeWorkSetInfo> HomeWorkSetSelectedCommand { get; set; }
public DelegateCommand<QuestionData> DeleteQuestionCommand { get; set; }
public DelegateCommand DeleteQuestionCommand { get; set; }
public DelegateCommand UpdateQuestionCommand { get; set; }
public DelegateCommand<MouseButtonEventArgs> ShowContextMenuCommand { get; set; }
public DelegateCommand<QuestionData> RemoveNewColumnCommand { get; set; }
public DelegateCommand<QuestionData> SelectedQuestionChangedCommand { get; set; }
public DelegateCommand RegionToDetailCommand { get; set; }
public DelegateCommand SubmitHomeWorkCommand { get; set; }
public DelegateCommand AddNewColumnCommand { get; set; }
@ -238,18 +251,49 @@ namespace StudentManager.Model
HomeWorkSelectedCommand = new DelegateCommand<DetailHomeWorkInfo>((e) =>
{
if (e == null) return;
//HomeWork =
//selectedHomeWork = e;
e.Status = true;
});
DeleteQuestionCommand = new DelegateCommand<QuestionData>((x) =>
DeleteQuestionCommand = new DelegateCommand(() =>
{
if (x == null) return;
if (SelectedQuestion == null) return;
var c = MessageBox.Show("确定删除吗?", "确认", MessageBoxButton.OKCancel);
if (c != MessageBoxResult.OK) return;
QuestionLib.Remove(x);
QuestionLib.Remove(SelectedQuestion);
QuestionDatas = QuestionLib.GetAllQuestion();
});
UpdateQuestionCommand = new DelegateCommand(() =>
{
if(SelectedQuestion == null) return;
var c = MessageBox.Show("确定修改吗?", "确认", MessageBoxButton.OKCancel);
if (c != MessageBoxResult.OK) return;
QuestionLib.Update(SelectedQuestion);
SelectedQuestion.UpdateTime = DateTime.Now;
SQLHelper.UpdateQuestion(SelectedQuestion);
});
ShowContextMenuCommand = new DelegateCommand<MouseButtonEventArgs>((e) =>
{
if (e.OriginalSource is FrameworkElement element)
{
var contextMenu = element.FindResource("MyContextMenu") as ContextMenu;
if (contextMenu != null)
{
contextMenu.PlacementTarget = element;
contextMenu.Placement = System.Windows.Controls.Primitives.PlacementMode.MousePoint;
contextMenu.IsOpen = true;
}
}
});
SelectedQuestionChangedCommand = new DelegateCommand<QuestionData>((x) =>
{
if(x == null) return;
SelectedQuestion = x;
});
RemoveNewColumnCommand = new DelegateCommand<QuestionData>((x) =>
{
@ -306,7 +350,7 @@ namespace StudentManager.Model
StudentDatas = new ReadOnlyObservableCollection<StudentInfo>(studentDatas);
QuestionDatas = new ObservableCollection<QuestionData>(questionDatas);
ErrorSetDatas = new ReadOnlyObservableCollection<DetailErrorInfo>(errorSetDatas);
ErrorSetDatas = new ObservableCollection<DetailErrorInfo>(errorSetDatas);
MenuBars = new ReadOnlyObservableCollection<MenuBar>(menuBars);
HomeWorkSet = new ObservableCollection<DetailHomeWorkSetInfo>(homeWorkSet);
@ -329,7 +373,7 @@ namespace StudentManager.Model
// update error set and local homework
SelectedStudent.HomeWorkSet.Get(SelectedHomeWorkSet.Lesson).Questions.ForEach(x =>
{
if (x.Status != HomeWork.FirstOrDefault(hw => hw.PID == x.ID).Status)
if (x.Status != HomeWork.FirstOrDefault(hw => hw.PID == x.ID).Status || selectedHomeWorkSet.Status == false)
{
x.Status = HomeWork.FirstOrDefault(hw => hw.PID == x.ID).Status;
SelectedStudent.ErrorSet.AddQuestion(x);
@ -337,6 +381,10 @@ namespace StudentManager.Model
}
});
SelectedStudent.HomeWorkSet.Get(SelectedHomeWorkSet.Lesson).UpdateData();
ErrorSet = SelectedStudent.ErrorSet.GetDetailErrorSetInfo();
ErrorSetDatas = SelectedStudent.ErrorSet.GetDetailErrorQuestionList();
// update homework other info and online info
SelectedStudent.HomeWorkSet.Get(SelectedHomeWorkSet.Lesson).Status = true;
@ -354,6 +402,14 @@ namespace StudentManager.Model
JsonConvert.SerializeObject(correctHomeworkArray), SelectedStudent.HomeWorkSet.Get(SelectedHomeWorkSet.Lesson).DateTime,
SelectedStudent.HomeWorkSet.Get(SelectedHomeWorkSet.Lesson).Status);
//TODO: Notify
}
private void UpdateData()
{
}
private void RegionToDetailView()