Beispiel #1
0
        public SubscriptionViewModel(Interfaces.ISubscriptionModel model)
        {
            this.model = (Models.SubscriptionModel)model;

            MonitoredItems = this.model.ToReactivePropertyAsSynchronized(
                x => x.MonitoredItems);

            this.DeleteMonitoredItemsCommand = this.model.DeleteMonitoredItemsCommand;
        }
Beispiel #2
0
        public NodeTreeModel(
            Interfaces.IConnection connector,
            Interfaces.IReference references,
            Interfaces.ISubscriptionModel subscriptionM,
            Interfaces.IOneTimeAccessModel oneTimeAccessM)
        {
            this.connector  = connector;
            this.references = references;

            ReloadCommand = new Commands.DelegateCommand(
                (param) => { ForceUpdate(); },
                (param) => connector.Connected);

            MouseDoubleClickedCommand = new DelegateCommand <IList>((items) =>
            {
                subscriptionM.AddToSubscription(items);
                ChangeSelectedIndexForTabContorol(0);
            }, (param) => true);

            AddToReadWriteCommand = new Commands.DelegateCommand(
                (param) => {
                oneTimeAccessM.AddToReadWrite((IList)param);
                ChangeSelectedIndexForTabContorol(1);
            },
                (param) => connector.Connected);

            NodeSelectedCommand = new Commands.DelegateCommand(
                (param) => { }, //nodeInfoDataGrid.Update((VariableNode)param); },
                (param) => true);

            UpdateVariableNodeListCommand = new Commands.DelegateCommand(
                (param) => { UpdateVariableNodes((Interfaces.IReference)param); },
                (param) => true);

            this.connector.ObserveProperty(x => x.Connected).Subscribe(c => Update(c));

            Initialize();
        }