diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-01-01 04:14:42 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-01-01 04:14:42 +0200 |
| commit | 904753380ad0621f604b8ff38dfc59371b78bda3 (patch) | |
| tree | 5116d74dc63b660f0aa0fb9d328584a11f5d2e06 /Software/Visual_Studio/Tango.Touch/Controls | |
| parent | 7fdd6c233aafbb0dabbad5a74faac0592f76fa53 (diff) | |
| download | Tango-904753380ad0621f604b8ff38dfc59371b78bda3.tar.gz Tango-904753380ad0621f604b8ff38dfc59371b78bda3.zip | |
Fixed some bugs with thread loading wizard.
fail proof notification bar min height. (maybe timing issue)
PPC auto update first check after 30 seconds always regardless of settings.
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch/Controls')
| -rw-r--r-- | Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.cs | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.cs index 8ed4ead69..1e5a5c8fe 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.cs @@ -145,7 +145,7 @@ namespace Tango.Touch.Controls _items_control = GetTemplateChild("PART_ItemsControl") as ItemsControl; _notification_counter_grid = GetTemplateChild("PART_NotificationCounterGrid") as Grid; _scrollViewer = GetTemplateChild("PART_ScrollViewer") as LightTouchScrollViewer; - + _border_drag.RegisterForPreviewMouseOrTouchDown(GridNotificationMouseDown); _border_drag.RegisterForMouseOrTouchMove(GridNotificationMouseMove); _border_drag.RegisterForPreviewMouseOrTouchUp(GridNotificationMouseUp); @@ -169,11 +169,11 @@ namespace Tango.Touch.Controls { _grid_mask.Opacity = _border_drag.ActualHeight / ActualHeight; - if (e.NewSize.Height > CurrentMinHeight && CurrentMinHeight > 0 ) + if (e.NewSize.Height > CurrentMinHeight && CurrentMinHeight > 0) { _notification_counter_grid.Visibility = Visibility.Hidden; } - else if(Notifications.Count > 1 && CurrentMinHeight > 0) + else if (Notifications.Count > 1 && CurrentMinHeight > 0) { _notification_counter_grid.Visibility = Visibility.Visible; } @@ -201,10 +201,10 @@ namespace Tango.Touch.Controls } } - private void UpdateMinHeightByDispalyedItem() + private async void UpdateMinHeightByDispalyedItem() { var last = GetLastNotification(); - if(last != null) + if (last != null) { last.RegisterForLoadedOrNow((x, y) => { @@ -214,11 +214,16 @@ namespace Tango.Touch.Controls _grid_container.Height = CurrentMinHeight; }); } + else if (Notifications.Count > 0) + { + await Task.Delay(500); + UpdateMinHeightByDispalyedItem(); + } } - /// <summary> - /// Callback function on Notifications property - /// </summary> - private void OnNotificationsChanged() + /// <summary> + /// Callback function on Notifications property + /// </summary> + private void OnNotificationsChanged() { if (Notifications is INotifyCollectionChanged) { @@ -226,7 +231,7 @@ namespace Tango.Touch.Controls { this.BeginInvoke(() => { - if(Notifications.Count > 0) + if (Notifications.Count > 0) { UpdateMinHeightByDispalyedItem(); } @@ -239,11 +244,11 @@ namespace Tango.Touch.Controls _notification_counter_grid.Visibility = Visibility.Hidden; } }); - }; - + }; + } } - + #region Mouse handlers private void OpenNotifications() { @@ -272,7 +277,7 @@ namespace Tango.Touch.Controls tAni.Duration = TimeSpan.FromSeconds(0.3); tAni.To = new Thickness(0); _border_notifications.BeginAnimation(Border.BorderThicknessProperty, tAni); - + IsExpanded = false; Task.Delay(400).ContinueWith((x) => |
