12345678910111213141516171819202122232425262728293031323334353637383940 |
- using System.Windows;
- using System.Windows.Input;
- namespace Waaagh.CustomControl {
- public class WaaaghWindow: Window {
- #region Static
- static WaaaghWindow() {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(WaaaghWindow), new FrameworkPropertyMetadata(typeof(WaaaghWindow)));
- }
- public static readonly DependencyProperty TitleBarContentProperty = DependencyProperty.Register(
- "TitleBarContent", typeof(object), typeof(WaaaghWindow),
- new PropertyMetadata(null));
- public static readonly DependencyProperty TitleBarButtonsProperty = DependencyProperty.Register(
- "TitleBarButtons", typeof(List<object>), typeof(WaaaghWindow),
- new PropertyMetadata(new List<object>()));
- #endregion
- public WaaaghWindow() {
- DefaultStyleKey = typeof(WaaaghWindow);
- CommandBindings.Add(new CommandBinding(SystemCommands.CloseWindowCommand, (s, e) => { SystemCommands.CloseWindow(this); }));
- CommandBindings.Add(new CommandBinding(SystemCommands.MinimizeWindowCommand, (s, e) => { SystemCommands.MinimizeWindow(this); }));
- CommandBindings.Add(new CommandBinding(SystemCommands.MaximizeWindowCommand, (s, e) => { SystemCommands.MaximizeWindow(this); }));
- CommandBindings.Add(new CommandBinding(SystemCommands.RestoreWindowCommand, (s, e) => { SystemCommands.RestoreWindow(this); }));
- }
- public object TitleBarContent {
- get { return (object)GetValue(TitleBarContentProperty); }
- set { SetValue(TitleBarContentProperty, value); }
- }
- public List<object> TitleBarButtons {
- get { return (List<object>)GetValue(TitleBarButtonsProperty); }
- set { SetValue(TitleBarButtonsProperty, value); }
- }
- }
- }
|