add application item info
authorYurii Zinchuk/Tizen Services & IoT (PLT) /SRPOL/Engineer/Samsung Electronics <y.zinchuk@samsung.com>
Tue, 30 Jan 2024 11:30:27 +0000 (12:30 +0100)
committerYurii Zinchuk/Tizen Services & IoT (PLT) /SRPOL/Engineer/Samsung Electronics <y.zinchuk@samsung.com>
Fri, 16 Feb 2024 18:00:49 +0000 (19:00 +0100)
SettingMainGadget/SettingMainGadget/Apps/AppManager.cs

index 7e4675d2d7d9f6b7042ce2aa39921a9e6b2f85e9..43aacdd3213c11cbf2dcd47c4098f0dc0f1105e2 100644 (file)
@@ -1,7 +1,9 @@
 using SettingCore;
 using System;
 using System.Collections.Generic;
+using System.ComponentModel;
 using System.Linq;
+using System.Runtime.CompilerServices;
 using Tizen.Applications;
 
 namespace SettingMainGadget.Apps
@@ -50,5 +52,46 @@ namespace SettingMainGadget.Apps
 
             return listInfo.Where(a => a.Categories.Contains(category)).ToList();
         }
+
+        public class ApplicationItemInfo : INotifyPropertyChanged
+        {
+            public event PropertyChangedEventHandler PropertyChanged;
+            public string AppId { get; }
+            public string PackageId { get; set; }
+            public string Name { get; set; }
+            public string IconPath { get; set; }
+            public long AppSize { get; set; }
+            public System.DateTime LastLaunchTime { get; set; }
+
+            private string size;
+            public string SizeToDisplay
+            {
+                get => size;
+                set
+                {
+                    if (value != size)
+                    {
+                        size = value;
+                        RaisePropertyChanged(nameof(SizeToDisplay));
+                    }
+                }
+            }
+
+            public ApplicationItemInfo(string appid, string name, string iconPath, string size)
+            {
+                AppId = appid;
+                Name = name;
+                IconPath = iconPath;
+                SizeToDisplay = size;
+            }
+
+            /// <summary>
+            /// Raises PropertyChanged event.
+            /// </summary>
+            protected void RaisePropertyChanged([CallerMemberName] string propertyName = null)
+            {
+                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+            }
+        }
     }
 }