public UserApiForwardViewModel(IHexApiService aHexApi, User aUser, ApiSite aApiSite) { mHexApi = aHexApi; mUser = aUser; mApiSite = aApiSite; mMessagesToForward = new ObservableCollection <EMessageType>(aApiSite.SupportedMessages); mMessagesToIgnore = new ObservableCollection <EMessageType>(); foreach (var theUserApiForward in aUser.Forwards) { if (theUserApiForward.Type == aApiSite.Type) { mForwardToThis = theUserApiForward.ForwardToThis; mApiKey = theUserApiForward.ApiKey; foreach (var theMessageType in aApiSite.SupportedMessages) { if (!theUserApiForward.Messages.Contains(theMessageType)) { mMessagesToIgnore.Add(theMessageType); mMessagesToForward.Remove(theMessageType); } } } } SendToRightCommand = new RelayCommand <EMessageType>(SendToRight); SendToLeftCommand = new RelayCommand <EMessageType>(SendToLeft); SendAllToRightCommand = new RelayCommand(SendAllToRight, () => MessagesToForward.Any()); SendAllToLeftCommand = new RelayCommand(SendAllToLeft, () => MessagesToIgnore.Any()); }
public MainViewModel(IHexApiService aHexApi, IDialogService aDialogs) { mHexApi = aHexApi; if (!IsInDesignMode) { OpenSettingsCommand = new RelayCommand(OpenSettings, () => !SettingsVisible); CloseSettingsCommand = new RelayCommand(CloseSettings, () => SettingsVisible); } }
public MessageViewModel(IHexApiService aHexService, IFileService aFileService, IDialogService aDialogs) { mHexApi = aHexService; mFile = aFileService; mDialogs = aDialogs; ShowMessageCommand = new RelayCommand <IMessage>(ShowMessage); PickMessageCommand = new RelayCommand(PickMessage); mHexApi.InitializationCompleted += HandleInitializationCompleted; }
public SettingsViewModel(IHexApiService aHexApi) { mHexApi = aHexApi; mHexApi.InitializationCompleted += HandleInitializationCompleted; }
public AuctionHouseViewModel(IHexApiService aHexApi) { mHexApi = aHexApi; mHexApi.InitializationCompleted += HandleInitializationCompleted; }