/// <summary> /// 触发录播任务变动事件 /// </summary> /// <param name="scheduleKey">发生变动的录播任务</param> /// <param name="message">对应的消息类型</param> public void Trigger(string scheduleKey, RecordScheduleMessageType message) { var content = ((int)message).ToString() + scheduleKey; object existing = string.Empty; ApplicationData.Current.LocalSettings.Values.TryGetValue(queueKey, out existing); if (string.IsNullOrEmpty(existing as string)) ApplicationData.Current.LocalSettings.Values[queueKey] = content; else ApplicationData.Current.LocalSettings.Values[queueKey] += ';' + content; // 触发事件 ApplicationData.Current.SignalDataChanged(); }
private async void Schedule_Changed(string scheduleKey, RecordScheduleMessageType message) { if (LinkedSchedule == null) { return; // 该任务被删除时触发 } if (scheduleKey != LinkedSchedule.Key) { return; } if (message == RecordScheduleMessageType.StatusChanged) { await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => RaisePropertyChanged(nameof(Status))); } }