/// <summary> /// Default Constructor /// </summary> public WireViewModel(IWire wire) { Wire = wire ?? throw new ArgumentNullException(nameof(wire)); RemoveWireCommand = new RelayCommand(RemoveWire); WireSocketClickedCommand = new RelayParametrizedCommand(WireSocketClicked); WireClickedCommand = new RelayParametrizedCommand(WireClicked); }
/// <summary> /// Default Constructor /// </summary> public Monitoring() { ManagedServices = new ReadOnlyObservableCollection <MonitoringService>(_ManagedServices); Log = new ReadOnlyObservableCollection <string>(_Log); RemoveServiceCommand = new RelayParametrizedCommand(RemoveService); RequestExtendedSession(); }
/// <summary> /// Default Constructor /// </summary> /// <param name="url">Url of the site to check (typically one of educational platforms)</param> /// <param name="name">Name of the person to look for</param> /// <param name="period">Period between refreshing, in seconds. Should fit between the min and max allowed value</param> public MonitoringService(string url, ObservableCollection <string> names, ICommand removeServiceCommand, int period = 30) { Url = url; Names = names; RemoveServiceCommand = removeServiceCommand; Period = CheckPeriodValue(period); AddNewNameCommand = new RelayCommand(AddNewName); RemoveNameCommand = new RelayParametrizedCommand(RemoveName); PauseCommand = new RelayCommand(Pause); }
/// <summary> /// Default Constructor /// </summary> public ComponentViewModel(IBaseComponent component) { Component = component ?? throw new ArgumentNullException(nameof(component) + " cannot be null"); RotateLeftCommand = new RelayCommand(RotateLeft); RotateRightCommand = new RelayCommand(RotateRight); RemoveComponentCommand = new RelayCommand(RemoveComponent); SocketClickedCommand = new RelayParametrizedCommand(SocketClicked); EngageFocusCommand = new RelayCommand(EngageFocus); DisengageFocusCommand = new RelayCommand(DisengageFocus); ReverseVoltageDropsCommand = new RelayCommand(ReverseVoltageDrops); ProceedToAnotherInfoSectionCommand = new RelayCommand(ProceedToAnotherInfoSection); IoC.Resolve <IFocusManager>().FocusedComponentChanged += FocusedComponentChanged; }
/// <summary> /// Default constructor /// </summary> public Menu() { this.DefaultStyleKey = typeof(Menu); this.Loaded += OnLoaded; // Initialize the colleciton Content = new ObservableCollection <UIElement>(); // Make the first calculation of the translate RecalculateContentTranslate(); // Initialize the ICommands IconPressedCommand = new RelayParametrizedCommand(IconPressed); OpenCloseMenuCommand = new RelayCommand(OpenCloseMenu); RepositionMenuCommand = new RelayParametrizedCommand(RepositionMenu); }
/// <summary> /// Default Constructor /// </summary> public DesignViewModel() { if (IoC.Container.TryResolve(out IDesignManager manager)) { DesignManager = manager; } else { throw new Exception(); } DesignManager.PropertyChanged += WireManipulated; StopActionCommand = new RelayCommand(StopAction); DesignAreaClickedCommand = new RelayParametrizedCommand(DesignAreaClicked); PrepareToPlaceLooseWireCommand = new RelayCommand(PrepareToPlaceLooseWire); EditComponentCommand = new RelayParametrizedCommand(EditComponent); }
/// <summary> /// Default constructor /// </summary> public AppViewModel() { ProcessKeyPressCommand = new RelayParametrizedCommand(ProcessKeyPress); }