예제 #1
0
        protected void SetModel(object sender, DependencyPropertyChangedEventArgs e)
        {
            Model = DataContext as ConditionComponentListingModel;
            if (Model == null) return;

            EditButton.Visibility = Model.Atom.Type == Calculator.ConditionAtomType.Nested ?
                Visibility.Hidden : Visibility.Visible;
        }
예제 #2
0
        public void Initialise(ConditionContainer condition)
        {
            ObservableCollection<ConditionComponentListingModel> atoms = new ObservableCollection<ConditionComponentListingModel>();
            if (condition != null && condition.AndConditions != null)
            {
                foreach (ConditionAtom atom in condition.AndConditions)
                {
                    ConditionComponentListingModel componentModel = new ConditionComponentListingModel(atom);
                    componentModel.OnEdit += EditComponentModel;
                    componentModel.OnDelete += DeleteComponentModel;
                    atoms.Add(componentModel);
                }
            }
            AndAtoms = atoms;

            atoms = new ObservableCollection<ConditionComponentListingModel>();
            if (condition != null && condition.OrConditions != null)
            {
                foreach (ConditionAtom atom in condition.OrConditions)
                {
                    ConditionComponentListingModel componentModel = new ConditionComponentListingModel(atom);
                    componentModel.OnEdit += EditComponentModel;
                    componentModel.OnDelete += DeleteComponentModel;
                    atoms.Add(componentModel);
                }
            }
            OrAtoms = atoms;
        }
예제 #3
0
 public ConditionComponentListingModel GetConditionAtomForOr()
 {
     ConditionAtom atom = new ConditionAtom();
     ConditionComponentListingModel componentModel = new ConditionComponentListingModel(atom);
     componentModel.OnEdit += EditComponentModel;
     componentModel.OnDelete += DeleteComponentModel;
     OrAtoms.Add(componentModel);
     return componentModel;
 }