public BandStrapp(BandTiles tiles, CargoStrapp strapp) { Strapp = strapp; _tiles = tiles; TileImage = strapp.Image.ToWriteableBitmap(); }
internal void UpdateStrapp(CargoStrapp strapp) { _client.UpdateStrapp(strapp); // here is where it gets a bit hairy. If we just call UpdateStrapp alone // it will shove the updated Tile at the end of the strip, which is undesirable // so let's resave the strip so that the tiles go back to the same location Save(); }
private void ListBox_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { ListBox parent = sender as ListBox; CargoStrapp data = GetObjectDataFromPoint(parent, e.GetPosition(parent)) as CargoStrapp; if (data != null) { DragDrop.DoDragDrop(parent, data, DragDropEffects.Move); } }
// Drag & Drop care of http://stackoverflow.com/a/4004590 private void ListBox_Drop(object sender, DragEventArgs e) { ListBox parent = sender as ListBox; CargoStrapp data = e.Data.GetData(typeof(CargoStrapp)) as CargoStrapp; CargoStrapp objectToPlaceBefore = GetObjectDataFromPoint(parent, e.GetPosition(parent)) as CargoStrapp; if (data != null && objectToPlaceBefore != null) { int index = _band.Tiles.Strip.IndexOf(objectToPlaceBefore); _band.Tiles.Strip.Remove(data); _band.Tiles.Strip.Insert(index, data); parent.SelectedItem = data; } }
public BandStrapp(BandTiles tiles, CargoStrapp strapp) { Strapp = strapp; _tiles = tiles; }