|
@@ -380,14 +380,15 @@ namespace PRSDesktop
|
|
|
|
|
|
private void PopulateFavourites(ItemsControl menu, RoutedEventHandler action, DateTime time, bool filltime)
|
|
private void PopulateFavourites(ItemsControl menu, RoutedEventHandler action, DateTime time, bool filltime)
|
|
{
|
|
{
|
|
|
|
+
|
|
|
|
+ menu.Items.RemoveAt(0);
|
|
|
|
+ var create = new MenuItem { Header = "Create New Assignment" };
|
|
|
|
+ create.Tag = new Tuple<DateTime, AssignmentFavourite>(time, null);
|
|
|
|
+ create.Click += action;
|
|
|
|
+ menu.Items.Insert(0,create);
|
|
|
|
+
|
|
if (_settings.Favourites?.Any() == true)
|
|
if (_settings.Favourites?.Any() == true)
|
|
{
|
|
{
|
|
- menu.Items.RemoveAt(0);
|
|
|
|
-
|
|
|
|
- var create = new MenuItem { Header = "Create New Assignment" };
|
|
|
|
- create.Tag = new Tuple<DateTime, AssignmentFavourite>(time, null);
|
|
|
|
- create.Click += action;
|
|
|
|
- menu.Items.Insert(0,create);
|
|
|
|
menu.Items.Insert(1,new Separator());
|
|
menu.Items.Insert(1,new Separator());
|
|
int i = 2;
|
|
int i = 2;
|
|
foreach (var favourite in _settings.Favourites)
|
|
foreach (var favourite in _settings.Favourites)
|
|
@@ -526,6 +527,10 @@ namespace PRSDesktop
|
|
CheckandSaveAssignment();
|
|
CheckandSaveAssignment();
|
|
SelectAssignment(ass.Item);
|
|
SelectAssignment(ass.Item);
|
|
}
|
|
}
|
|
|
|
+ else
|
|
|
|
+
|
|
|
|
+ SelectAssignment(null);
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
private void CheckandSaveAssignment()
|
|
private void CheckandSaveAssignment()
|
|
@@ -537,7 +542,7 @@ namespace PRSDesktop
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private void SelectAssignment(Assignment assignment)
|
|
|
|
|
|
+ private void SelectAssignment(Assignment? assignment)
|
|
{
|
|
{
|
|
Logger.Send(LogType.Information, ClientFactory.UserID, "Into Assignment_SelectionChanged()");
|
|
Logger.Send(LogType.Information, ClientFactory.UserID, "Into Assignment_SelectionChanged()");
|
|
bSelectingAssignment = true;
|
|
bSelectingAssignment = true;
|