Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Timepicker easier to customize #4514

Open
ScarletKuro opened this issue Sep 2, 2024 · 0 comments
Open

Make Timepicker easier to customize #4514

ScarletKuro opened this issue Sep 2, 2024 · 0 comments

Comments

@ScarletKuro
Copy link

Describe the feature

I want to increase the popup size of the TimePicker (maybe even override it in future). For example, this is easily achievable with the Calendar control:

<Style x:Key="MahApps.Styles.Resized.Calendar" TargetType="{x:Type Calendar}" BasedOn="{StaticResource MahApps.Styles.Calendar}">
	<Setter Property="Template">
		<Setter.Value>
			<ControlTemplate TargetType="{x:Type Calendar}">
				<Viewbox Height="450" Width="450">
					<Grid x:Name="PART_Root"
						  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
						  Background="Transparent">
						<CalendarItem x:Name="PART_CalendarItem"
									  Background="{TemplateBinding Background}"
									  BorderBrush="{TemplateBinding BorderBrush}"
									  BorderThickness="{TemplateBinding BorderThickness}"
									  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
									  Style="{TemplateBinding CalendarItemStyle}"  />
					</Grid>
				</Viewbox>
			</ControlTemplate>
		</Setter.Value>
	</Setter>
</Style>

However, it’s much harder with the TimePicker. First of all, you can't do this:

<Style x:Key="MahApps.Styles.Resized.Time" TargetType="{x:Type mah:TimePicker}" BasedOn="{StaticResource MahApps.Styles.TimePickerBase}">

The problem is that MahApps.Styles.TimePickerBase is missing.

Second, I’d like to have more modularity. For example, it would be great if the popup could have a separate style that you could easily override, like:

<mah:TimePicker PopupStyle={...}>

Otherwise, you need to copy and paste the entire DateTimePicker.xaml.

@ScarletKuro ScarletKuro changed the title Make Timepicker easier to customizate Make Timepicker easier to customize Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant