public MainWindow() { InitializeComponent(); LocationViewModel = new LocationDisplayItem(); SetDataContext(); // call after initilaze component _controler = new MainWindowControler(this); }
public LocationTabControler(MainWindowControler mainControler, MainWindow window) : base(window, mainControler) { DisplayItem = new LocationDisplayItem(); Window.LocationContentGrid.DataContext = DisplayItem; Window.ShootingLocationControl.Leaving += ShootingLocationNameControl_Leaving; Window.ParkingLocationControl.Leaving += ParkingLocationControl_Leaving; RefreshShootingLocationsFromDB(); RefreshParkingLocationsFromDB(); _listerWindow = new LocationListerWindow(base.Window, this); _currentChangeMode = E_ChangeMode.no_change; }
internal static E_DBReturnCode SmartAddShootingLocation(LocationDisplayItem displayItem, long subjectLocationId, long parkingLocationId, out string errorMessage) { var photosAsByteArray = new List <byte[]>(); if (displayItem.Photo_1 != null) { photosAsByteArray.Add(ImageTools.BitmapImageToByteArray(displayItem.Photo_1)); } if (displayItem.Photo_2 != null) { photosAsByteArray.Add(ImageTools.BitmapImageToByteArray(displayItem.Photo_2)); } if (displayItem.Photo_3 != null) { photosAsByteArray.Add(ImageTools.BitmapImageToByteArray(displayItem.Photo_3)); } var shootingLocationName = displayItem.ShootingLocationName; var shootingLocationGPS = new GPSCoordinates(displayItem.ShootingLocationLatitude, displayItem.ShootingLocationLongitude); return(PersistenceManager.SmartAddShootingLocation(subjectLocationId, parkingLocationId, photosAsByteArray, shootingLocationName, shootingLocationGPS, out errorMessage)); }