protected virtual void RegisterTarget(IServiceProvider serviceProvider) { var provideValueTarget = serviceProvider.GetService(typeof(IProvideValueTarget)) as IProvideValueTarget; object target = provideValueTarget.TargetObject; if (target != null) { TargetProperty = provideValueTarget.TargetProperty; TargetObjects.Add(new WeakReference(target)); } }
protected virtual void AvailableObjectsList_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { ListBox listBox = (ListBox)sender; if (listBox.SelectedIndex < 0) { return; } ObjectOfAlbertrizal objectOfAlbertrizal = StoredObjects[listBox.SelectedIndex]; TargetObjects.Add(objectOfAlbertrizal); AddedObjectsList.Items.Add(objectOfAlbertrizal); ListChanged(); }
public void AddTargetObject(GameObject gameObject) { TargetObjects.Add(gameObject); _safeDistances.Add(this.HitboxRadius + gameObject.HitboxRadius); }