internal CheckAllTargetCommand(InteractionTabVM tabVM, Guid targetWidgetGuid, bool checkAll) { _tabVM = tabVM; _checkAll = checkAll; if (_checkAll) { _list = new List <Guid>(); // Only store target list if check all is checked. foreach (WidgetNode node in _tabVM.WidgetList) { if (node.IsSelected) { _list.Add(node.TargetObject.Guid); } } } ISelectionService selectionService = ServiceLocator.Current.GetInstance <SelectionServiceProvider>(); if (selectionService != null) { _pageVM = selectionService.GetCurrentPage(); if (_pageVM != null) { IWidgetPropertyData widgetVM = _pageVM.GetSelectedwidgets().FirstOrDefault(x => x.WidgetID == targetWidgetGuid); _widgetVM = widgetVM as WidgetViewModBase; } } }
public void RemoveWidget(IWidgetPropertyData wdgVM) { if (_widgtes.Contains(wdgVM)) { INotifyPropertyChanged vm = wdgVM as INotifyPropertyChanged; vm.PropertyChanged -= WdgPropertyChangedHandler; _widgtes.Remove(wdgVM); } }
internal DeleteTargetCommand(InteractionTabVM tabVM, Guid targetValue, Guid targetWidgetGuid) { _tabVM = tabVM; _targetValue = targetValue; ISelectionService selectionService = ServiceLocator.Current.GetInstance <SelectionServiceProvider>(); if (selectionService != null) { _pageVM = selectionService.GetCurrentPage(); if (_pageVM != null) { IWidgetPropertyData widgetVM = _pageVM.GetSelectedwidgets().FirstOrDefault(x => x.WidgetID == targetWidgetGuid); _widgetVM = widgetVM as WidgetViewModBase; } } }
internal UrlChangeCommand(InteractionTabVM tabVM, string oldUrl, string newUrl, Guid targetWidgetGuid) { _tabVM = tabVM; _oldUrl = oldUrl; _newUrl = newUrl; ISelectionService selectionService = ServiceLocator.Current.GetInstance <SelectionServiceProvider>(); if (selectionService != null) { _pageVM = selectionService.GetCurrentPage(); if (_pageVM != null) { IWidgetPropertyData widgetVM = _pageVM.GetSelectedwidgets().FirstOrDefault(x => x.WidgetID == targetWidgetGuid); _widgetVM = widgetVM as WidgetViewModBase; } } }
internal WidgetNoteCommand(NotesViewModel notesVM, string propertyName, string oldValue, string newValue, Guid targetWidgetGuid) { _notesVM = notesVM; _propertyName = propertyName; _oldValue = oldValue; _newValue = newValue; ISelectionService selectionService = ServiceLocator.Current.GetInstance <SelectionServiceProvider>(); if (selectionService != null) { _pageVM = selectionService.GetCurrentPage(); if (_pageVM != null) { IWidgetPropertyData widgetVM = _pageVM.GetSelectedwidgets().FirstOrDefault(x => x.WidgetID == targetWidgetGuid); _widgetVM = widgetVM as WidgetViewModBase; } } }
internal ExternalLinkCommand(InteractionTabVM tabVM, bool oldValue, bool newValue, Guid targetWidgetGuid, string externalLink) { _tabVM = tabVM; _oldValue = oldValue; _newValue = newValue; _externalLink = externalLink; ISelectionService selectionService = ServiceLocator.Current.GetInstance <SelectionServiceProvider>(); if (selectionService != null) { _pageVM = selectionService.GetCurrentPage(); if (_pageVM != null) { IWidgetPropertyData widgetVM = _pageVM.GetSelectedwidgets().FirstOrDefault(x => x.WidgetID == targetWidgetGuid); _widgetVM = widgetVM as WidgetViewModBase; } } }
public void RegisterWidget(IWidgetPropertyData wdgVM) { if (_widgtes.Contains(wdgVM)) { return; } INotifyPropertyChanged vm = wdgVM as INotifyPropertyChanged; vm.PropertyChanged += WdgPropertyChangedHandler; //_widgtes.Add(wdgVM); try { _widgtes.Add(wdgVM); } catch (System.Exception ex) { Debug.WriteLine(ex.Message); } }