A state persistence Dto for widget data.
Наследование: IPersistentApplicationStateObject
Пример #1
0
        public ObservableCollection<WidgetGroup> LoadPersistedStateData(WidgetsApplicationState storedState)
        {
            if (storedState == null)
            {
                throw new ArgumentNullException(nameof(storedState));
            }

            WidgetGroups = new ObservableCollection<WidgetGroup>(this.widgetService.PrepareWidgets(storedState.WidgetStates));
            UpdateAllWidgets();
            foreach (var group in WidgetGroups)
            {
                foreach (var widget in @group.Widgets.Where(widget => widget.RecommendedTimeIntervalUpdate != null))
                {
                    ScheduledWidgetUpdate(widget);
                }
            }

            return WidgetGroups;
        }