
Security News
NIST Under Federal Audit for NVD Processing Backlog and Delays
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
A timeline control for WPF, available for personal or commercial use under the MIT license.
Install the NuGet package or download the source add add it to your Solution.
In your Window or UserControl, add the XAML namespace:
xmlns:tim="clr-namespace:WpfTimelineControl;assembly=WpfTimelineControl"
Add the Timeline control:
<Grid>
<tim:Timeline x:Name="myTimeline" />
</Grid>
Through a Data Binding or code-behind, set the Timeline's DataContext:
List<TimelineEntry> entries = new List<TimelineEntry>
{
new TimelineBar("Event 1", DateTime.Now, TimeSpan.FromSeconds(92), 0),
new TimelinePoint("Event 2", DateTime.Now, TimeSpan.FromSeconds(17), 1),
};
var timelineBuilder = TimelineBuilderFactory.Create();
var viewModel = timelineBuilder.BuildViewModel(entries.ToArray());
myTimeline.DataContext = viewModel;
See the Demo Apps for a demonstration of all the customisation options.
To customise the colours of the timeline entries, set TimelineEntryBrushes
:
<tim:Timeline TimelineEntryBrushes="{StaticResource TimelineItemColors}" />
<Application.Resources>
<SolidColorBrush x:Key="CorporateColor" Color="#2397D3" />
<x:Array Type="SolidColorBrush" x:Key="TimelineItemColors">
<SolidColorBrush Color="{Binding Color,Source={StaticResource CorporateColor1}}" />
<SolidColorBrush Color="#E9C43B" />
</x:Array>
</Application.Resources>
Type: Brush[]
Default: { Brushes.Red, Brushes.Green, Brushes.Blue, Brushes.Yellow, Brushes.Magenta }
To change the colour used for the 'Labels exceed bars' setting, set LabelsExceedBarsSettingColorIndex
:
<tim:Timeline LabelsExceedBarsSettingColorIndex="2" />
Type: int
Default: 0
To choose whether the events' name labels are coloured, set ColoredEntryNameLabels
:
<tim:Timeline ColoredEntryNameLabels="True" />
Type: Boolean
Default: True
The 3 strings used in the control can be translated using NameLabel
, StartLabel
and EndLabel
<tim:Timeline NameLabel="{lex:Loc Key=LBL_Name}"
StartLabel="{lex:Loc Key=LBL_Start}"
EndLabel="{lex:Loc Key=LBL_End}" />
Type: string
Default: "Name"
, "Start"
, "End"
With the top bar hidden, you can fix the LabelsExceedBars
setting:
<tim:Timeline LabelsExceedBars="False" />
Type: Boolean
Default: True
Add a title to the timeline by setting Title
:
viewModel.Title = "Events Today"
Type: string
Default: NULL
Hide the settings controls on the top bar by setting ShowControls
:
viewModel.ShowControls = false
Type: Boolean
Default: true
Hide the longer date interval markers by setting ShowDateMarkers
:
viewModel.ShowDateMarkers = false
Type: Boolean
Default: true
With the top bar hidden, you can fix the PixelsPerInterval
setting, which affects the width of each interval and therefore of the timeline control:
viewModel.PixelsPerInterval = 160;
Type: int
Default: 320
With the top bar hidden, you can fix the MajorIntervalSeconds
setting, which sets the timescale represented by each interval:
viewModel.MajorIntervalSeconds = TimelineConstants.IntervalOptions[3];
Type: int
Default: [calculated based on the events]
The TimelineConstants
class contains two static variables that control the behaviour of the timeline control.
The TimelineBuilder
uses these values, which I have set based on my experience using this control at my previous company, but you may need to tweak them based on your data.
The timeline is always linear; each interval represents the same amount of time. The builder chooses one of the values from the IntervalOptions
array, from 10 seconds up to 60 minutes.
The builder calculates the total duration of the events (from the beggining of the first to the end of the last) then divides this by the TimelineScalingFactor
and finds the closest value from the options array.
FAQs
Customisable timeline control for WPF applications.
We found that wpftimelinecontrol demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.