private async Task <ObservableCollection <RecordScreenModel> > HeatingScreens(List <RecordScreenModel> screens)
        {
            ObservableCollection <RecordScreenModel> result = new ObservableCollection <RecordScreenModel>();

            using (var db = new PrototypingContext())
            {
                User user = db.Users.Single(u => u.UserId == RecordModel.UserId);
                await db.Entry(user)
                .Reference(u => u.Prototype)
                .LoadAsync();

                string prototypeName = user.Prototype.Name + "_" + user.PrototypeId;
                string userName      = user.Name + "_" + user.UserId;
                string recordName    = "Record_" + RecordModel.RecordId;

                StorageFolder prototypeFolder = await ApplicationData.Current.LocalFolder.CreateFolderAsync(prototypeName, CreationCollisionOption.OpenIfExists); //PrototypeName + Id

                StorageFolder userFolder = await prototypeFolder.CreateFolderAsync(userName, CreationCollisionOption.OpenIfExists);                               //UserName + Id

                StorageFolder recordFolder = await userFolder.CreateFolderAsync(recordName, CreationCollisionOption.OpenIfExists);

                foreach (RecordScreenModel screen in screens)
                {
                    screen.HeatMapScreen = await HeatMapFunctions.CreateProcessHeatMap(screen.OriginalScreen, screen.ListPoints);

                    result.Add(screen);

                    string[] screenPaths = await SaveImagesInStorage(screen.OriginalScreen, screen.HeatMapScreen, recordFolder); //saving images in prototype -> user -> record path

                    RecordScreen rScreen = new RecordScreen()
                    {
                        RecordId             = RecordModel.RecordId,
                        Points               = screen.ListPoints,
                        UriPage              = screen.UriPage,
                        PathToOriginalScreen = screenPaths[0],
                        PathToHeatMapScreen  = screenPaths[1]
                    };
                    db.RecordScreens.Add(rScreen);
                    db.SaveChanges();
                }
            }
            return(result);
        }
        private async Task <ObservableCollection <RecordScreenModel> > HeatingRecordScreens(List <RecordScreen> allScreen)
        {
            ObservableCollection <RecordScreenModel> result = new ObservableCollection <RecordScreenModel>();

            while (allScreen.Count != 0)
            {
                List <HeatPoint> points   = allScreen.FindAll(s => s.UriPage.Equals(allScreen[0].UriPage)).SelectMany(s => s.Points).ToList();
                WriteableBitmap  original = await HeatMapFunctions.AsWrBitmapFromFile(allScreen[0].PathToOriginalScreen);

                WriteableBitmap heatMap = await HeatMapFunctions.CreateProcessHeatMap(original, points);

                result.Add(new RecordScreenModel()
                {
                    UriPage        = allScreen[0].UriPage,
                    OriginalScreen = original,
                    HeatMapScreen  = heatMap,
                    ListPoints     = points
                });
                string uri = allScreen[0].UriPage;
                allScreen.RemoveAll(s => s.UriPage.Equals(uri));
            }

            return(result);
        }