2019-03-21 16:05:16 +01:00
|
|
|
|
/*
|
2024-03-05 18:37:42 +01:00
|
|
|
|
* Copyright (c) 2024 ETH Zürich, IT Services
|
2019-03-21 16:05:16 +01:00
|
|
|
|
*
|
|
|
|
|
* 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;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Controls;
|
2021-03-18 23:12:07 +01:00
|
|
|
|
using SafeExamBrowser.Core.Contracts.Resources.Icons;
|
2019-08-30 09:55:26 +02:00
|
|
|
|
using SafeExamBrowser.UserInterface.Contracts.Shell.Events;
|
2019-05-08 09:56:34 +02:00
|
|
|
|
using SafeExamBrowser.UserInterface.Shared.Utilities;
|
2019-03-21 16:05:16 +01:00
|
|
|
|
|
2020-03-17 10:37:08 +01:00
|
|
|
|
namespace SafeExamBrowser.UserInterface.Mobile.Controls.Taskbar
|
2019-03-21 16:05:16 +01:00
|
|
|
|
{
|
2020-03-17 10:37:08 +01:00
|
|
|
|
internal partial class QuitButton : UserControl
|
2019-03-21 16:05:16 +01:00
|
|
|
|
{
|
2020-03-17 10:37:08 +01:00
|
|
|
|
internal event QuitButtonClickedEventHandler Clicked;
|
2019-03-21 16:05:16 +01:00
|
|
|
|
|
2020-03-17 10:37:08 +01:00
|
|
|
|
public QuitButton()
|
2019-03-21 16:05:16 +01:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
LoadIcon();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Button_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Clicked?.Invoke(new CancelEventArgs());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void LoadIcon()
|
|
|
|
|
{
|
|
|
|
|
var uri = new Uri("pack://application:,,,/SafeExamBrowser.UserInterface.Desktop;component/Images/ShutDown.xaml");
|
2019-12-03 15:43:48 +01:00
|
|
|
|
var resource = new XamlIconResource { Uri = uri };
|
2019-03-21 16:05:16 +01:00
|
|
|
|
|
|
|
|
|
Button.Content = IconResourceLoader.Load(resource);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|