public void Load() {
InitializeComponent();
if (_widgets == null) {
// creating a list of widget’s IDs
_widgets = Resources.MergedDictionaries.SelectMany(x => x.Keys.OfType<string>()).Where(x => x.StartsWith(@"Widget")).ToArray();
}
DataContext = new ViewModel(_widgets.Select(x => new WidgetEntry(x, (FrameworkElement)FindResource(x))).ToDictionary(x => x.Key, x => x));
}