private void FrameworkElement_Drop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.StringFormat)) { string data = (string)e.Data.GetData(DataFormats.StringFormat); Card_Region selectedRegion = Find_SelectedCard_Region((int)((FrameworkElement)sender).DataContext); selectedRegion.DesiredInherittedProperties.ImageProperties.BackgroundImageLocationType = IMAGE_LOCATION_TYPE.Online; selectedRegion.DesiredInherittedProperties.ImageProperties.BackgroundImageFillType = IMAGE_OPTIONS.Unified_Fill; selectedRegion.DesiredInherittedProperties.ImageProperties.BackgroundImageLocation = data; OnPropertyChanged("Drawing_Card_Elements"); } else if (e.Data.GetDataPresent(DataFormats.Bitmap)) { string data = (string)e.Data.GetData(DataFormats.Bitmap); } }
public Card(Card card) { _regions = new List <Card_Region>(card.Regions.Count); for (int i = 0; i < card.Regions.Count; ++i) { Card_Region tmp = new Card_Region(); tmp.id = card.Regions[i].id; tmp.description = card.Regions[i].description; tmp.ideal_location = card.Regions[i].ideal_location; _regions.Add(tmp); } if (card.Regions.Count == 0) { Card_Region tmp = new Card_Region(); tmp.id = 0; tmp.description = ""; tmp.ideal_location = new Rect(0, 0, 1, 1); _regions.Add(tmp); } if (card.Id == -2) { _regions[0].DesiredInherittedProperties.SetAllInheritValues(false); } _deckIds = new List <int>(card.DeckIds); _name = card.Name; }
public Card_Region(Card_Region reg) { ideal_location = reg.ideal_location; id = reg.id; _desiredProperties = reg._desiredProperties.Clone(); }