public DesignStockpileSample()
 {
     var c = new StockpileCriteriaEditable();
     /*
     c.ItemIDs.Add(ItemID.Log);
     c.ItemIDs.Add(ItemID.Door);
     c.MaterialCategories.Add(MaterialCategory.Wood);
     */
     this.Criteria = c.ToItemFilter();
 }
示例#2
0
        public DesignStockpileSample()
        {
            var c = new StockpileCriteriaEditable();

            /*
             * c.ItemIDs.Add(ItemID.Log);
             * c.ItemIDs.Add(ItemID.Door);
             * c.MaterialCategories.Add(MaterialCategory.Wood);
             */
            this.Criteria = c.ToItemFilter();
        }
        void StockpileEditControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            var stockpile = (Stockpile)this.DataContext;

            if (stockpile == null || stockpile.Criteria == null)
            {
                this.Criteria = new StockpileCriteriaEditable();
            }
            else
            {
                this.Criteria = new StockpileCriteriaEditable(stockpile.Criteria);
            }

            Notify("Criteria");
        }
        void StockpileEditControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            var stockpile = (Stockpile)this.DataContext;

            if (stockpile == null || stockpile.Criteria == null)
            {
                this.Criteria = new StockpileCriteriaEditable();
            }
            else
            {
                this.Criteria = new StockpileCriteriaEditable(stockpile.Criteria);
            }

            Notify("Criteria");
        }