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(); }
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"); }