@@ -8,7 +8,7 @@
|
||||
<StackPanel Margin="20" HorizontalAlignment="Left">
|
||||
<u:CalendarView DateSelected="CalendarView_OnOnDateSelected" DatePreviewed="CalendarView_OnOnDatePreviewed"/>
|
||||
<TextBlock Text="{Binding #singlePicker.SelectedDate}" ></TextBlock>
|
||||
<u:DatePicker Name="singlePicker" Width="200" />
|
||||
<u:DatePicker Name="singlePicker" Width="200" />
|
||||
<u:DateRangePicker Width="300" DisplayFormat="yyyyMMdd" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
BorderBrush="Transparent"
|
||||
BorderThickness="0"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
InnerLeftContent="{TemplateBinding InnerLeftContent}"
|
||||
InnerRightContent="{TemplateBinding InnerRightContent}"
|
||||
@@ -76,12 +77,13 @@
|
||||
Padding="8"
|
||||
Background="{DynamicResource ComboBoxPopupBackground}"
|
||||
BorderBrush="{DynamicResource ComboBoxPopupBorderBrush}"
|
||||
BoxShadow="{DynamicResource ComboBoxPopupBoxShadow}"
|
||||
BorderThickness="{DynamicResource ComboBoxPopupBorderThickness}"
|
||||
BoxShadow="{DynamicResource ComboBoxPopupBoxShadow}"
|
||||
CornerRadius="{DynamicResource CalendarCornerRadius}">
|
||||
<u:CalendarView
|
||||
Name="PART_Calendar"
|
||||
BorderThickness="0"
|
||||
FontSize="{DynamicResource DefaultFontSize}"
|
||||
CornerRadius="{Binding $parent[Border].CornerRadius}"
|
||||
FirstDayOfWeek="{TemplateBinding FirstDayOfWeek}"
|
||||
IsTodayHighlighted="{TemplateBinding IsTodayHighlighted}" />
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
Background="Transparent"
|
||||
BorderThickness="1"
|
||||
CornerRadius="3 0 0 3"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
InnerLeftContent="{TemplateBinding InnerLeftContent}"
|
||||
IsReadOnly="{TemplateBinding IsReadonly}" />
|
||||
@@ -50,6 +51,7 @@
|
||||
VerticalAlignment="Stretch"
|
||||
Background="Transparent"
|
||||
CornerRadius="0"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
InnerRightContent="{TemplateBinding InnerRightContent}"
|
||||
IsReadOnly="{TemplateBinding IsReadonly}" />
|
||||
@@ -117,6 +119,7 @@
|
||||
Grid.Column="0"
|
||||
Margin="8"
|
||||
BorderThickness="0"
|
||||
FontSize="{DynamicResource DefaultFontSize}"
|
||||
CornerRadius="{Binding $parent[Border].CornerRadius}"
|
||||
FirstDayOfWeek="{TemplateBinding FirstDayOfWeek}"
|
||||
IsTodayHighlighted="{TemplateBinding IsTodayHighlighted}" />
|
||||
@@ -125,6 +128,7 @@
|
||||
Grid.Column="1"
|
||||
Margin="8"
|
||||
BorderThickness="0"
|
||||
FontSize="{DynamicResource DefaultFontSize}"
|
||||
CornerRadius="{Binding $parent[Border].CornerRadius}"
|
||||
FirstDayOfWeek="{TemplateBinding FirstDayOfWeek}"
|
||||
IsTodayHighlighted="{TemplateBinding IsTodayHighlighted}" />
|
||||
|
||||
@@ -165,8 +165,8 @@ public class CalendarDayButton : ContentControl
|
||||
|
||||
public event EventHandler<CalendarDayButtonEventArgs> DatePreviewed
|
||||
{
|
||||
add => AddHandler(DateSelectedEvent, value);
|
||||
remove => RemoveHandler(DateSelectedEvent, value);
|
||||
add => AddHandler(DatePreviewedEvent, value);
|
||||
remove => RemoveHandler(DatePreviewedEvent, value);
|
||||
}
|
||||
|
||||
protected override void OnPointerReleased(PointerReleasedEventArgs e)
|
||||
|
||||
@@ -82,7 +82,7 @@ public class DatePicker: DatePickerBase, IClearControl
|
||||
_textBox = e.NameScope.Find<TextBox>(PART_TextBox);
|
||||
_calendar = e.NameScope.Find<CalendarView>(PART_Calendar);
|
||||
|
||||
Button.ClickEvent.AddHandler(OnButtonClick, RoutingStrategies.Tunnel, true, _button);
|
||||
Button.ClickEvent.AddHandler(OnButtonClick, RoutingStrategies.Bubble, true, _button);
|
||||
GotFocusEvent.AddHandler(OnTextBoxGetFocus, _textBox);
|
||||
TextBox.TextChangedEvent.AddHandler(OnTextChanged, _textBox);
|
||||
PointerPressedEvent.AddHandler(OnTextBoxPointerPressed, RoutingStrategies.Tunnel, false, _textBox);
|
||||
|
||||
@@ -128,7 +128,7 @@ public class DateRangePicker : DatePickerBase
|
||||
_startTextBox = e.NameScope.Find<TextBox>(PART_StartTextBox);
|
||||
_endTextBox = e.NameScope.Find<TextBox>(PART_EndTextBox);
|
||||
|
||||
Button.ClickEvent.AddHandler(OnButtonClick, RoutingStrategies.Tunnel, true, _button);
|
||||
Button.ClickEvent.AddHandler(OnButtonClick, RoutingStrategies.Bubble, true, _button);
|
||||
GotFocusEvent.AddHandler(OnTextBoxGetFocus, _startTextBox, _endTextBox);
|
||||
TextBox.TextChangedEvent.AddHandler(OnTextChanged, _startTextBox, _endTextBox);
|
||||
PointerPressedEvent.AddHandler(OnTextBoxPointerPressed, RoutingStrategies.Tunnel, false, _startTextBox, _endTextBox);
|
||||
|
||||
Reference in New Issue
Block a user