Fix the DatePicker calling condition judgment problem

This commit is contained in:
chinboy
2025-01-21 19:21:58 +08:00
parent 5c42a6508d
commit 0e105ac308
4 changed files with 6 additions and 5 deletions
@@ -45,7 +45,7 @@ internal class BaseCalendarDayButtonTheme : BaseControlTheme
contentPresenter.Content = buttonLabel;
BindUtils.RelayBind(calendarDayButton, BaseCalendarDayButton.ContentProperty, buttonLabel, TextBlock.TextProperty,
input => input?.ToString());
BindUtils.RelayBind(calendarDayButton, BaseCalendarDayButton.ForegroundProperty, buttonLabel, TextBlock.ForegroundProperty);
BindUtils.RelayBind(contentPresenter, ContentPresenter.ForegroundProperty, buttonLabel, TextBlock.ForegroundProperty);
CreateTemplateParentBinding(contentPresenter, ContentPresenter.PaddingProperty,
TemplatedControl.PaddingProperty);
@@ -35,16 +35,16 @@ internal class CalendarDayButtonTheme : BaseControlTheme
VerticalContentAlignment = VerticalAlignment.Center,
};
var buttonLabel = new TextBlock()
var buttonLabel = new TextBlock
{
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
};
contentPresenter.Content = buttonLabel;
BindUtils.RelayBind(calendarDayButton, BaseCalendarDayButton.ContentProperty, buttonLabel, TextBlock.TextProperty,
BindUtils.RelayBind(calendarDayButton, CalendarDayButton.ContentProperty, buttonLabel, TextBlock.TextProperty,
input => input?.ToString());
BindUtils.RelayBind(calendarDayButton, BaseCalendarDayButton.ForegroundProperty, buttonLabel, TextBlock.ForegroundProperty);
BindUtils.RelayBind(contentPresenter, ContentPresenter.ForegroundProperty, buttonLabel, TextBlock.ForegroundProperty);
CreateTemplateParentBinding(contentPresenter, ContentPresenter.PaddingProperty,
TemplatedControl.PaddingProperty);
@@ -284,7 +284,7 @@ internal class FlyoutStateHelper : AvaloniaObject
return;
}
if (!Flyout.IsOpen)
if (!Flyout.IsOpen && TopLevel.GetTopLevel(AnchorTarget) == args.Root)
{
if (OpenFlyoutPredicate is not null)
{
+1
View File
@@ -1,4 +1,5 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Layout;
using Avalonia.Media;