Пример #1
0
 public void RefreshAppInfoItems()
 {
     for (int i = 0; i < PanApps.Children.Count; i++)
     {
         AppInfoItem aii = (AppInfoItem)PanApps.Children[i];
         if (aii != null)
         {
             aii.Refresh();
         }
     }
 }
Пример #2
0
        //载入
        private void LoadAppsInfo()
        {
            AppInfos.Clear();
            AppInfos.Add(AppInfo);
            AppInfos.Add(new AppInfo("E Writer"));
            AppInfos.Add(new AppInfo("E Player"));
            AppInfos.Add(new AppInfo("E Number"));
            AppInfos.Add(new AppInfo("E Role"));

            PanApps.Children.Clear();
            foreach (AppInfo item in AppInfos)
            {
                AppInfoItem aii = new AppInfoItem
                {
                    AppInfo = item
                };
                PanApps.Children.Add(aii);
            }

            //读取一个字符串,并加入播放列表
            if (!string.IsNullOrEmpty(Settings.Default.Paths))
            {
                string[] paths = Regex.Split(Settings.Default.Paths, ",");
                foreach (string item in paths)
                {
                    if (!File.Exists(item))
                    {
                        continue;
                    }

                    string  name = Path.GetFileNameWithoutExtension(item);
                    AppInfo ai   = AppInfos.Find(x => x.Name == name);
                    ai.FilePath = item;
                }
            }
        }
Пример #3
0
        private static void OnAppIconChanged(object sender, DependencyPropertyChangedEventArgs args)
        {
            AppInfoItem source = (AppInfoItem)sender;

            source.ImgIcon.Source = new BitmapImage(new Uri((string)args.NewValue, UriKind.Relative));
        }
Пример #4
0
        private static void OnAppStateChanged(object sender, DependencyPropertyChangedEventArgs args)
        {
            AppInfoItem source = (AppInfoItem)sender;

            source.LblState.Content = (string)args.NewValue;
        }