MahApps / MahApps/MahApps.Metro

Make Timepicker easier to customize

Open
#4,514 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request
Dominant language
C#
Stars
9.8k
Forks
2.4k
Avg merge
1h 2m
Merged PRs (30d)
56

Description

## 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:

```XAML

<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>

```

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

```
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`.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting DateTimePicker.xaml and the existing TimePicker styling, then compare it with the Calendar template shown in the issue. Define how a reusable TimePickerBase and separately overridable popup style would fit the current templates; done means users can resize and customize the popup without copying the entire DateTimePicker.xaml.

Written by the indexing model from the issue text.

Assessment

Domain
desktop
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.