29 lines
968 B
C#
29 lines
968 B
C#
using System;
|
|
using System.Globalization;
|
|
using System.IO;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Markup;
|
|
using System.Windows.Media;
|
|
|
|
namespace CustomWindow
|
|
{
|
|
public class WindowCloseButton : WindowButton
|
|
{
|
|
|
|
public WindowCloseButton()
|
|
{
|
|
// open resource where in XAML are defined some required stuff such as icons and colors
|
|
var resourceStream = Application.GetResourceStream(new Uri("pack://application:,,,/CustomWindow;component/ButtonIcons.xaml")).Stream;
|
|
var resourceDictionary = (ResourceDictionary)XamlReader.Load(resourceStream);
|
|
|
|
// set icon
|
|
Content = resourceDictionary["WindowButtonCloseIcon"];
|
|
ContentDisabled = resourceDictionary["WindowButtonCloseIconDisabled"];
|
|
|
|
// radius
|
|
//this.CornerRadius = new CornerRadius(0, 0, 3, 0);
|
|
}
|
|
}
|
|
}
|