public ChatMessageViewModel(IChatDataService dataService) { _dataService = dataService; _dataService.GetRandomMessage( (item, error) => { if (error != null) { // Report error here return; } Message = item; Initialize(item); }); }
public ChatMessageViewModel() { _dataService = SimpleIoc.Default.GetInstance <IChatDataService>(); Initialize(new ChatMessage("Lorem ipsum") { ChatName = SettingsRegistry.ChatTitleNormalTwitch, ChatIconURL = Icons.DesignMainIcon }); _dataService.GetRandomMessage( (item, error) => { if (error != null) { // Report error here return; } Message = item; Initialize(item); }); }