mirror of
https://github.com/VitalickS/BrightSharp.Toolkit.git
synced 2026-03-21 02:21:15 +00:00
Initial
This commit is contained in:
26
BrightSharp/Generic.cs
Normal file
26
BrightSharp/Generic.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
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
|
||||
{
|
||||
internal partial class Generic
|
||||
{
|
||||
private const string StyleDictionaryPattern = @"(?<=.+style\.)(.*?)(?=\.xaml)";
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user