diff --git a/speed-time/Dialogs/TrackTimeEditor.xaml b/speed-time/Dialogs/TrackTimeEditor.xaml
index 968a5da..dc0496e 100644
--- a/speed-time/Dialogs/TrackTimeEditor.xaml
+++ b/speed-time/Dialogs/TrackTimeEditor.xaml
@@ -3,16 +3,50 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
xmlns:potato="https://dsaladin.dev/products/fancypotato/wpf/xaml"
+ xmlns:localBehaviors="clr-namespace:DSaladin.SpeedTime.Behavior"
xmlns:fa="https://dsaladin.dev/products/fontawesome/wpf/xaml"
xmlns:converter="clr-namespace:DSaladin.SpeedTime.Converter"
xmlns:language="clr-namespace:DSaladin.SpeedTime.Language"
+ xmlns:model="clr-namespace:DSaladin.SpeedTime.Model"
xmlns:local="clr-namespace:DSaladin.SpeedTime.Dialogs"
d:DataContext="{d:DesignInstance local:TrackTimeEditor}"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="450" MaxHeight="300" MaxWidth="400">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -37,7 +71,7 @@
Click="Close_Click" />
+ HorizontalAlignment="Center" VerticalAlignment="Bottom" SelectAllOnFocus="True" TabIndex="-1">
@@ -47,20 +81,40 @@
-
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -69,7 +123,7 @@
-
+
@@ -79,9 +133,10 @@
-
-
+
+
diff --git a/speed-time/Dialogs/TrackTimeEditor.xaml.cs b/speed-time/Dialogs/TrackTimeEditor.xaml.cs
index c4fed34..55eebc7 100644
--- a/speed-time/Dialogs/TrackTimeEditor.xaml.cs
+++ b/speed-time/Dialogs/TrackTimeEditor.xaml.cs
@@ -3,6 +3,7 @@
using DSaladin.SpeedTime.Model;
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -40,12 +41,57 @@ public TrackTime TrackTime
}
}
- public string TrackTimeTitle { get; set; } = "";
+ private string trackTimeTitle = "";
+ public string TrackTimeTitle
+ {
+ get { return trackTimeTitle; }
+ set
+ {
+ trackTimeTitle = value;
+ NotifyPropertyChanged();
+ RefreshSuggestions();
+ }
+ }
+
+ private bool IsSuggestionsOpen = false;
+
public DateTime SelectedDate { get; set; } = DateTime.Today;
public DateTime TrackingStarted { get; set; } = DateTime.Today;
public DateTime TrackingStopped { get; set; }
public bool IsBreak { get; set; }
+ public double SuggestionsHeight
+ {
+ get
+ {
+ if (!IsSuggestionsOpen)
+ return 0;
+
+ if (TrackedTimesViewSource.View is null || string.IsNullOrEmpty(TrackTimeTitle) || TrackedTimesViewSource.View.Cast
diff --git a/speed-time/ViewModel/QuickTimeTrackerViewModel.cs b/speed-time/ViewModel/QuickTimeTrackerViewModel.cs
index 8a1c0f6..8632152 100644
--- a/speed-time/ViewModel/QuickTimeTrackerViewModel.cs
+++ b/speed-time/ViewModel/QuickTimeTrackerViewModel.cs
@@ -116,6 +116,9 @@ public QuickTimeTrackerViewModel(TrackTime? lastTrackTime)
TabButtonCommand = new((_) =>
{
+ if (TrackedTimesViewSource.View.Cast().Count() == 0)
+ return;
+
WorkTitle = TrackedTimesViewSource.View.Cast().ElementAt(SuggestionSelectedIndex).Title;
});
diff --git a/speed-time/speed-time.csproj b/speed-time/speed-time.csproj
index 24e3e5f..0cf7843 100644
--- a/speed-time/speed-time.csproj
+++ b/speed-time/speed-time.csproj
@@ -19,7 +19,7 @@
README.md
Icon.ico
LICENSE.txt
- 0.15.1
+ 0.16
True