public async Task LoadProject(CompoProject project)
		{
			_project = project;
			CalculateFit();
			await RefreshImage();
			if (project == null)
			{
				_frames.Clear();
			}
			else
			{
				_frames.Clear();
				foreach (var frame in project.Frames)
				{
					var frameModel = new CompoFrameViewModel();
					await frameModel.LoadFrame(frame, _pixelsPerInch);
					_frames.Add(frameModel);
				}
			}
			if (PropertyChanged != null)
			{
				PropertyChanged(this, new PropertyChangedEventArgs("ImageFilePath"));
				PropertyChanged(this, new PropertyChangedEventArgs("Image"));
				PropertyChanged(this, new PropertyChangedEventArgs("Frames"));
			}
		}
Beispiel #2
0
        public async Task LoadProject(CompoProject project)
        {
            _project = project;
            CalculateFit();
            await RefreshImage();

            if (project == null)
            {
                _frames.Clear();
            }
            else
            {
                _frames.Clear();
                foreach (var frame in project.Frames)
                {
                    var frameModel = new CompoFrameViewModel();
                    await frameModel.LoadFrame(frame, _pixelsPerInch);

                    _frames.Add(frameModel);
                }
            }
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs("ImageFilePath"));
                PropertyChanged(this, new PropertyChangedEventArgs("Image"));
                PropertyChanged(this, new PropertyChangedEventArgs("Frames"));
            }
        }