public void SetActiveControl(AddSingleRewardViewModel activeControl) { this.activeControl = activeControl; CommandManager.InvalidateRequerySuggested(); if (activeControl != null) { activeControl.IsInEditMode = true; activeControl.ControlWidth = activeControl.EditModeWidth; activeControl.GuildSelectionVisible = this.RewardReason == DataModel.Enums.RewardReason.Quest; } //reset other controls foreach (AddSingleRewardViewModel asr in rewardControls.Where(c => c != activeControl)) { asr.Reset(); //when no controls active set visible, when one active, set other to collapsed asr.Visibility = activeControl == null ? Visibility.Visible : Visibility.Collapsed; } }
public void RegisterControl(AddSingleRewardViewModel c) { rewardControls.Add(c); }