Exemple #1
0
        public ExpressionInstanceVM()
        {
            Reset = new DelegateCommand<object>(ResetHandler);
            Close = new DelegateCommand<object>(CloseHandler);

            _inputs = new ObservableCollection<ObservableInputVM>();
            Inputs = new ReadOnlyObservableCollection<ObservableInputVM>(_inputs);

            if (IsInDesignMode())
            {
                Definition = new ExpressionDefinition("Zip", "To jest opis Zip ... ", "(a,b) => z.Zip(b, (x,y) => x + y)");
                _inputs.Add(new ObservableInputVM());
                Output = new ObservableOutputVM();
            }
        }
Exemple #2
0
        public ExpressionInstanceVM()
        {
            Reset = new DelegateCommand <object>(ResetHandler);
            Close = new DelegateCommand <object>(CloseHandler);

            _inputs = new ObservableCollection <ObservableInputVM>();
            Inputs  = new ReadOnlyObservableCollection <ObservableInputVM>(_inputs);

            if (IsInDesignMode())
            {
                Definition = new ExpressionDefinition("Zip", "To jest opis Zip ... ", "(a,b) => z.Zip(b, (x,y) => x + y)");
                _inputs.Add(new ObservableInputVM());
                Output = new ObservableOutputVM();
            }
        }
Exemple #3
0
        private void ResetHandler(object obj)
        {
            CleanUp();
            _cleanedUp = false;
            _instance  = ExpressionInstance.Create(Definition);

            // input & output
            _inputs.Clear();
            foreach (var input in _instance.Inputs.Select(g => new ObservableInputVM(g)))
            {
                _inputs.Add(input);
            }

            Output = new ObservableOutputVM(_instance.Output);

            Diagram = _instance.Diagram;
        }
Exemple #4
0
        private void ResetHandler(object obj)
        {
            CleanUp();
            _cleanedUp = false;
            _instance = ExpressionInstance.Create(Definition);

            // input & output
            _inputs.Clear();
            foreach (var input in _instance.Inputs.Select(g => new ObservableInputVM(g)))
                _inputs.Add(input);

            Output = new ObservableOutputVM(_instance.Output);

            Diagram = _instance.Diagram;
        }