Explorar o código

Fixed DeliveryPanel calendar

Kenric Nugteren hai 2 semanas
pai
achega
6e51ae58f8

+ 2 - 14
prs.desktop/Components/Calendar/Calendar.xaml.cs

@@ -610,8 +610,8 @@ namespace PRSDesktop
         private DynamicDataGrid<Meeting>? mg;
         
         public bool IsReady { get; set; }
-        
-        public CalendarSettings Properties { get; set; }
+
+        public CalendarSettings Properties { get; set; } = new();
 
         public Calendar()
         {
@@ -643,7 +643,6 @@ namespace PRSDesktop
         {
             using (new EventSuppressor(Suppress.Settings, Suppress.Refresh, Suppress.Events))
             {
-         
                 Properties = LoadSettings?.Invoke(this) ?? new CalendarSettings();
                 SettingsVisible = Properties.SettingsVisible;
                 SelectedDate = Properties.AlwaysStartOnToday ? DateTime.Today : Properties.Date;
@@ -660,17 +659,6 @@ namespace PRSDesktop
                 AlwaysTodayBox.IsChecked = Properties.AlwaysStartOnToday;
 
                 ReloadColumns();
-                // var widthtimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(100) };
-                // widthtimer.Tick += (o, e) =>
-                // {
-                //     if (Bookings.ActualWidth > 0.0F)
-                //     {
-                //         widthtimer.IsEnabled = false;
-                //         ReloadColumns();
-                //     }
-                // };
-                // widthtimer.IsEnabled = true;
-            
             }
         }
         

+ 0 - 2
prs.desktop/Panels/Delivery/DeliveryPanel.xaml

@@ -51,8 +51,6 @@
                         CustomiseContextMenu="Bookings_OnCustomiseContextMenu"
                         LoadSettings="Bookings_OnLoadSettings"
                         SaveSettings="Bookings_OnSaveSettings"
-                        SettingsVisible="Hidden"
-                        HeaderVisibility="Visible"
                         />
                     <!-- AssignmentSelectionChanged="Bookings_SelectionChanged" -->
                     <!-- AssignmentChanged="Bookings_AssignmentChanged" -->

+ 3 - 1
prs.desktop/Panels/Delivery/DeliveryPanel.xaml.cs

@@ -59,6 +59,8 @@ namespace PRSDesktop
             SplitPanel.AnchorWidth = settings.AnchorWidth;
 
             Bookings.Setup();
+            Bookings.SettingsVisible = CalendarSettingsVisibility.Hidden;
+            Bookings.HeaderVisibility = Visibility.Visible;
             
             Deliveries.ColumnsTag = settings.ViewType == ScreenViewType.Register ? settings.ViewType.ToString() : "";
             Deliveries.Refresh(true, false);
@@ -263,7 +265,7 @@ namespace PRSDesktop
             new UserConfiguration<DeliveryScreenSettings>().Save(settings);
         }
         
-        private void Bookings_OnCustomiseContextMenu(object sender, ICalendarDataEventArgs args)
+        private void Bookings_OnCustomiseContextMenu(object sender, CalendarDataMenuEventArgs args)
         {
         
             if (sender is not ContextMenu menu)