Esempio n. 1
0
 public FrameCreateViewModel()
 {
     ImageFrameModel               = ImageFrameModel.NewInstance();
     ImageFrameModel.Saved        += ImageFrameModel_Saved;
     ImageFrameModel.ErrorOccured += ImageFrameModel_ErrorOccured;
     SaveCommand  = new RelayCommand(Save);
     notification = new MessagePopupNotification();
 }
            public void SetupView()
            {
                FramedImageOperation framedImageOperation = new FramedImageOperation();

                IEnumerable <FramedImageDTO> framedImages = null;

                try
                {
                    framedImages = framedImageOperation.GetAll();
                }
                catch (Exception e)
                {
                    UserInteraction.MessageBox.Show(e.Message);
                    GetMainWindow().Show();
                }

                var framedImageDataList = framedImages.ToList();

                if (framedImageDataList.Count > 0)
                {
                    foreach (FramedImageDTO framedImageDataItem in framedImageDataList)
                    {
                        ImageFrameModel model = ImageFrameModel
                                                .Existing(
                            framedImageDataItem.Id,
                            framedImageDataItem.ImageFilepath,
                            framedImageDataItem.Caption,
                            framedImageDataItem.EnableCaption,
                            framedImageDataItem.Witdh,
                            framedImageDataItem.Height,
                            framedImageDataItem.FrameThickness,
                            framedImageDataItem.LocationX,
                            framedImageDataItem.LocationY,
                            framedImageDataItem.RotateAngle,
                            framedImageDataItem.EnableShadow,
                            framedImageDataItem.ShadowOpacity,
                            framedImageDataItem.ShadowDepth,
                            framedImageDataItem.ShadowDirection,
                            framedImageDataItem.ShadowBlurRadius
                            );

                        ImageFrame imageFrame            = new ImageFrame();
                        imageFrame.GetModel().Parameters = new Dictionary <string, object>()
                        {
                            { ImageFrameViewModel.IMAGE_FRAME_MODEL_PARAMETER, model }
                        };
                        imageFrame.Show();
                    }
                }
                else
                {
                    MainWindow mainWindow = (MainWindow)GetMainWindow();
                    mainWindow.Show();
                    mainWindow.Focus();
                }
            }
Esempio n. 3
0
 public ImageFrameViewLauncher(ImageFrameModel model)
 {
     ImageFrameModel = model;
 }
Esempio n. 4
0
 private void Save()
 {
     ImageFrameModel.Save();
 }