private void InitServices(ElvenarEnv elvenar) { _elvenar = elvenar; _macroService = new MacroService(elvenar.Symbols, elvenar.Macros, LeftClick, GetMousePosition, KeyPress); _views = new ObservableCollection <ViewModelBase> { new QuestViewModel(elvenar.Quests, _macroService), new PolierenViewModel(elvenar.Polieren, elvenar.MyPosition, _macroService), new OtherViewModel(), }; NotifyPropertyChanged("CurrentView"); }
private void OpenSymbolWindow(object sender, RoutedEventArgs e) { var viewModel = new SymbolViewModel(_elvenar.Symbols); var symbolWindow = new SymbolWindow(viewModel, new MouseHook(), new KeyboardHook()); if (symbolWindow.ShowDialog() != true) { return; } _elvenar.Symbols = viewModel.Symbols.ToArray(); var service = new MacroService(_elvenar.Symbols, _elvenar.Macros, LeftClick, GetMousePosition, KeyPress); foreach (var replace in viewModel.ReplaceSymbolNames) { service.ReplaceSymbolName(Macros, replace.Key, replace.Value); } SetModified(true); }
public PolierenViewModel(IEnumerable <string> polieren, int myPosition, MacroService macroService) : base(macroService) { PolierenList = new ObservableCollection <string>(polieren ?? new string[0]); MyPosition = myPosition; }
public QuestViewModel(IEnumerable <string> quests, MacroService macroService) : base(macroService) { QuestList = new ObservableCollection <string>(quests ?? new string[0]); NextIndex = -1; }
public ViewModelBase(MacroService macroService) { _macroService = macroService; }