file reorganization #2

This commit is contained in:
2017-08-31 13:39:03 +03:00
parent 4e40c7281a
commit 9c2dc48ee2
23 changed files with 171 additions and 69 deletions

View File

@@ -0,0 +1,51 @@
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
namespace BrightSharp.Themes
{
internal partial class Theme
{
public Theme() {
}
public void CalendarPreviewMouseUp(object sender, MouseEventArgs e)
{
if (Mouse.Captured is CalendarItem) { Mouse.Capture(null); }
}
public void DatePickerUnloaded(object sender, RoutedEventArgs e)
{
if (sender == null) return;
DependencyObject child = ((Popup)((DatePicker)sender).Template.FindName("PART_Popup", (FrameworkElement)sender))?.Child;
while (child != null && !(child is AdornerDecorator))
child = VisualTreeHelper.GetParent(child) ?? LogicalTreeHelper.GetParent(child);
if (((AdornerDecorator)child)?.Child is Calendar) ((AdornerDecorator)child).Child = null;
}
private void closeButton_Click(object sender, RoutedEventArgs e)
{
var window = Window.GetWindow((DependencyObject)sender);
window.Close();
}
private void maximizeButton_Click(object sender, RoutedEventArgs e)
{
var window = Window.GetWindow((DependencyObject)sender);
window.WindowState = window.WindowState == WindowState.Normal ? WindowState.Maximized : WindowState.Normal;
}
private void minimizeButton_Click(object sender, RoutedEventArgs e)
{
var window = Window.GetWindow((DependencyObject)sender);
window.WindowState = WindowState.Minimized;
}
}
}