/// <summary> /// Constructor /// </summary> /// <param name="section"> /// The prize section to be presented. /// </param> public PrizeSectionIconVM(IPrizeSection section) { _section = section ?? throw new ArgumentNullException(nameof(section)); _section.PropertyChanged += OnSectionChanged; _section.PrizePlacement.PropertyChanged += OnPrizeChanged; }
/// <summary> /// Constructor /// </summary> /// <param name="imageSourceBase"> /// A string representing the base image source. /// </param> /// <param name="section"> /// An item that is to be represented by this control. /// </param> public PrizeLargeItemVM(string imageSourceBase, IPrizeSection section) { _section = section ?? throw new ArgumentNullException(nameof(section)); _imageSourceBase = imageSourceBase ?? throw new ArgumentNullException(nameof(imageSourceBase)); _section.PropertyChanged += OnSectionChanged; }
/// <summary> /// Constructor /// </summary> /// <param name="undoRedoManager"> /// The undo/redo manager. /// </param> /// <param name="undoableFactory"> /// The factory for creating undoable actions. /// </param> /// <param name="imageSourceBase"> /// A string representing the base image source. /// </param> /// <param name="section"> /// An item that is to be represented by this control. /// </param> public PrizeLargeItemVM( IUndoRedoManager undoRedoManager, IUndoableFactory undoableFactory, IPrizeSection section, string imageSourceBase) { _undoRedoManager = undoRedoManager; _undoableFactory = undoableFactory; _section = section; _imageSourceBase = imageSourceBase; HandleClick = ReactiveCommand.Create <PointerReleasedEventArgs>(HandleClickImpl); _section.PropertyChanged += OnSectionChanged; }
/// <summary> /// Creates a new prize large item control ViewModel instance representing the specified /// item type. /// </summary> /// <param name="type"> /// The item type to be represented. /// </param> /// <returns> /// A new prize large item control ViewModel instance. /// </returns> private ILargeItemVMBase GetPrizeLargeItemControlVM(LargeItemType type) { IPrizeSection section = type switch { LargeItemType.Aga1 => (IPrizeSection)_locations[LocationID.AgahnimTower].Sections[1], LargeItemType.Aga2 => (IPrizeSection)_locations[LocationID.GanonsTower].Sections[4], _ => throw new ArgumentOutOfRangeException(nameof(type)) }; return(_prizeFactory( section, $"avares://OpenTracker/Assets/Images/Prizes/{type.ToString().ToLowerInvariant()}")); }
/// <summary> /// Constructor /// </summary> /// <param name="prizes"> /// The prizes dictionary. /// </param> /// <param name="undoRedoManager"> /// The undo/redo manager. /// </param> /// <param name="undoableFactory"> /// A factory for creating undoable actions. /// </param> /// <param name="section"> /// The prize section to be represented. /// </param> public PrizeSmallItemVM( IPrizeDictionary prizes, IUndoRedoManager undoRedoManager, IUndoableFactory undoableFactory, IPrizeSection section) { _prizes = prizes; _undoRedoManager = undoRedoManager; _undoableFactory = undoableFactory; _section = section; HandleClick = ReactiveCommand.Create <PointerReleasedEventArgs>(HandleClickImpl); _section.PropertyChanged += OnSectionChanged; _section.PrizePlacement.PropertyChanged += OnPrizeChanged; }
/// <summary> /// Returns a new small item control ViewModel instance representing a dungeon prize. /// </summary> /// <param name="section"> /// The prize section. /// </param> /// <returns> /// A new small item control ViewModel instance. /// </returns> private static PrizeSmallItemVM GetPrizeSmallItemControlVM(IPrizeSection section) { return(new PrizeSmallItemVM(section)); }