コード例 #1
0
ファイル: BandStrapp.cs プロジェクト: talmuth/unBand
        public BandStrapp(BandTiles tiles, CargoStrapp strapp)
        {
            Strapp = strapp;
            _tiles = tiles;

            TileImage = strapp.Image.ToWriteableBitmap();
        }
コード例 #2
0
ファイル: BandStrapp.cs プロジェクト: misspierc/unBand
        public BandStrapp(BandTiles tiles, CargoStrapp strapp)
        {
            Strapp = strapp;
            _tiles = tiles;

            TileImage = strapp.Image.ToWriteableBitmap();
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
        // 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;
            }
        }
コード例 #6
0
 public BandStrapp(BandTiles tiles, CargoStrapp strapp)
 {
     Strapp = strapp;
     _tiles = tiles;
 }