2019-03-21 16:05:16 +01:00
|
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2019 ETH Zürich, Educational Development and Technology (LET)
|
|
|
|
|
*
|
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Controls;
|
2019-08-30 09:55:26 +02:00
|
|
|
|
using SafeExamBrowser.Client.Contracts;
|
|
|
|
|
using SafeExamBrowser.UserInterface.Contracts.Shell;
|
2019-05-08 09:56:34 +02:00
|
|
|
|
using SafeExamBrowser.UserInterface.Shared.Utilities;
|
2019-03-21 16:05:16 +01:00
|
|
|
|
|
|
|
|
|
namespace SafeExamBrowser.UserInterface.Mobile.Controls
|
|
|
|
|
{
|
|
|
|
|
public partial class TaskbarNotificationButton : UserControl, INotificationControl
|
|
|
|
|
{
|
2019-09-04 14:11:19 +02:00
|
|
|
|
private INotificationController controller;
|
2019-03-21 16:05:16 +01:00
|
|
|
|
|
2019-09-04 14:11:19 +02:00
|
|
|
|
public TaskbarNotificationButton(INotificationController controller, INotificationInfo info)
|
2019-03-21 16:05:16 +01:00
|
|
|
|
{
|
2019-09-04 14:11:19 +02:00
|
|
|
|
this.controller = controller;
|
|
|
|
|
|
2019-03-21 16:05:16 +01:00
|
|
|
|
InitializeComponent();
|
|
|
|
|
InitializeNotificationIcon(info);
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-04 14:11:19 +02:00
|
|
|
|
private void IconButton_Click(object sender, RoutedEventArgs e)
|
2019-03-21 16:05:16 +01:00
|
|
|
|
{
|
2019-09-04 14:11:19 +02:00
|
|
|
|
controller.Activate();
|
2019-03-21 16:05:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void InitializeNotificationIcon(INotificationInfo info)
|
|
|
|
|
{
|
|
|
|
|
IconButton.ToolTip = info.Tooltip;
|
|
|
|
|
IconButton.Content = IconResourceLoader.Load(info.IconResource);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|