public void AddWidget(string creatorName) { var widget = WidgetCreatorRegistry.CreateWidgetFor(creatorName); _entityService.AddWidgetToEntityScreen(SelectedEntityScreen.Name, widget); widget.Height = 100; widget.Width = 100; widget.AutoRefresh = true; Widgets.Add(WidgetCreatorRegistry.CreateWidgetViewModel(widget, _applicationState)); }
public void AddWidget(string creatorName) { var widget = WidgetCreatorRegistry.CreateWidgetFor(creatorName); _resourceService.AddWidgetToResourceScreen(SelectedResourceScreen.Name, widget); widget.Height = 100; widget.Width = 100; widget.AutoRefresh = true; Widgets.Add(WidgetCreatorRegistry.CreateWidgetViewModel(widget)); }
public void LoadTrackableEntityScreenItems() { IsDesignModeActive = true; Widgets = new ObservableCollection <IDiagram>(_entityService.LoadWidgets(SelectedEntityScreen.Name).Select(x => WidgetCreatorRegistry.CreateWidgetViewModel(x, _applicationState))); Widgets.ToList().ForEach(x => x.DesignMode = true); RaisePropertyChanged(() => Widgets); }
public void Refresh(EntityScreen entityScreen, OperationRequest <Entity> currentOperationRequest) { _entityService.UpdateEntityScreen(entityScreen); if (_currentEntityScreen != entityScreen || Widgets == null) { _currentEntityScreen = entityScreen; Widgets = new ObservableCollection <IDiagram>(entityScreen.Widgets.Select(x => WidgetCreatorRegistry.CreateWidgetViewModel(x, _applicationState))); } Widgets.Where(x => x.AutoRefresh).ToList().ForEach(x => x.Refresh()); RaisePropertyChanged(() => Widgets); RaisePropertyChanged(() => SelectedEntityScreen); }