private void InitUiModels()
        {
            StylesVariationList           = new ObservableCollection <ImageItem>();
            StylesVariationListSelectedId = new ObservableInt {
                Number = -1
            };
            StylesVariationListSelectedItem = new ObservableImageItem();
            CurrentVariantCategory          = new ObservableString();
            CurrentVariantCategoryId        = new ObservableInt {
                Number = -1
            };
            VariantsCategory   = new ObservableCollection <string>();
            SelectedFontId     = new ObservableInt();
            SelectedFontFamily = new ObservableFont();

            StylesPreviewList           = new ObservableCollection <ImageItem>();
            StylesPreviewListSelectedId = new ObservableInt {
                Number = -1
            };
            StylesPreviewListSelectedItem = new ObservableImageItem();

            ImageSelectionList = new ObservableCollection <ImageItem>();
            ImageSelectionList.Add(CreateChoosePicturesItem());

            Settings = StoragePath.LoadSettings();

            if (StoragePath.IsFirstTimeUsage())
            {
                Logger.Log("First time use PSL");
                ImageSelectionList.Add(CreateSamplePic1Item());
                ImageSelectionList.Add(CreateSamplePic2Item());
            }
            else
            {
                var loadedImageSelectionList = StoragePath.LoadPictures();
                foreach (var item in loadedImageSelectionList)
                {
                    if (item.FullSizeImageFile == null && item.BackupFullSizeImageFile != null)
                    {
                        item.FullSizeImageFile = item.BackupFullSizeImageFile;
                    }
                    else if (item.FullSizeImageFile == null && item.BackupFullSizeImageFile == null)
                    {
                        Logger.Log("Corrupted picture found. To be removed");
                        continue;
                    }
                    ImageSelectionList.Add(item);
                }
            }

            ImageSelectionListSelectedId = new ObservableInt {
                Number = -1
            };
            ImageSelectionListSelectedItem = new ObservableImageItem();
            IsActiveDownloadProgressRing   = new ObservableBoolean {
                Flag = false
            };
        }
示例#2
0
 private void InitializeBinaryDigits()
 {
     for (var i = 0; i < _binaryDigits.GetLength(0); i++)
     {
         for (var j = 0; j < _binaryDigits.GetLength(1); j++)
         {
             _binaryDigits[i, j] = new ObservableBoolean(false);
         }
     }
 }
示例#3
0
        private void InitUiModels()
        {
            StylesVariationList           = new ObservableCollection <ImageItem>();
            StylesVariationListSelectedId = new ObservableInt {
                Number = -1
            };
            StylesVariationListSelectedItem = new ObservableImageItem();
            CurrentVariantCategory          = new ObservableString();
            CurrentVariantCategoryId        = new ObservableInt {
                Number = -1
            };
            VariantsCategory   = new ObservableCollection <string>();
            SelectedFontId     = new ObservableInt();
            SelectedFontFamily = new ObservableFont();

            StylesPreviewList           = new ObservableCollection <ImageItem>();
            StylesPreviewListSelectedId = new ObservableInt {
                Number = -1
            };
            StylesPreviewListSelectedItem = new ObservableImageItem();

            ImageSelectionList = new ObservableCollection <ImageItem>();
            ImageSelectionList.Add(CreateChoosePicturesItem());

            var loadedImageSelectionList = StoragePath.Load();

            foreach (var item in loadedImageSelectionList)
            {
                ImageSelectionList.Add(item);
            }

            ImageSelectionListSelectedId = new ObservableInt {
                Number = -1
            };
            ImageSelectionListSelectedItem = new ObservableImageItem();
            IsActiveDownloadProgressRing   = new ObservableBoolean {
                Flag = false
            };
        }