Example #1
0
        public EquipmentOverrideWindow(RootViewModel rootViewModel)
        {
            InitializeComponent();

            this.rootViewModel = rootViewModel;

            Func <IList <EquipmentSaveSlotInfo>, EquipmentSaveSlotInfo> saveSlotSelector = SaveDataUtils.CreateSaveSlotSelector <EquipmentSaveSlotInfo>(this);

            rootViewModel.EquipmentOverride.SetSaveSelector(saveSlotSelector);

            InputBindings.Add(new InputBinding(new AnonymousCommand(OnCancel), new KeyGesture(Key.Escape, ModifierKeys.None)));

            this.Loaded += EquipmentOverrideWindow_Loaded;
        }
Example #2
0
        public DecorationsOverrideWindow(RootViewModel rootViewModel)
        {
            InitializeComponent();

            this.rootViewModel = rootViewModel;

            Func <IList <DecorationsSaveSlotInfo>, DecorationsSaveSlotInfo> saveSlotSelector = SaveDataUtils.CreateSaveSlotSelector <DecorationsSaveSlotInfo>(this);

            decorationsOverrideViewModel = new DecorationsOverrideViewModel(GlobalData.Instance.Jewels, saveSlotSelector);

            InputBindings.Add(new InputBinding(new AnonymousCommand(OnCancel), new KeyGesture(Key.Escape, ModifierKeys.None)));

            DataContext = decorationsOverrideViewModel;
        }
        public void OnOpening(bool isAlreadyOpened, object argument)
        {
            if (isAlreadyOpened)
            {
                return;
            }

            rootViewModel.WeaponsContainer.UpdateHighlights();

            Func <IList <EquipmentSaveSlotInfo>, EquipmentSaveSlotInfo> saveSlotSelector = SaveDataUtils.CreateSaveSlotSelector <EquipmentSaveSlotInfo>(this);

            rootViewModel.WeaponsContainer.SetSaveSlotSelector(saveSlotSelector);
        }