public ProductListViewModel() { _uiMetadata = new UIMetadata { LabelProvider = () => "Product List" }; Products = new ObservableCollection <Product> { new Product { Name = "Mac Book Pro", Quantity = 2 }, new Product { Name = "Domain Driven Design Book", Quantity = 3 }, new Product { Name = "RAM Memory", Quantity = 23 }, new Product { Name = "C# - Bible Book", Quantity = 15 }, new Product { Name = "Amazon Kindle", Quantity = 12 } }; EditProductCommand = new SimpleCommand <object>(OnEditProductCommand); }
public AboutView() { InitializeComponent(); _uiMetadata = new UIMetadata { LabelProvider = () => "About" }; }
public HomeView() { InitializeComponent(); _uiMetadata = new UIMetadata { LabelProvider = () => "Home" }; }
public ProductEditViewModel(Product product) { _uiMetadata = new UIMetadata { LabelProvider = () => "Edit a product" }; IsDirty = true; Product = product; SaveCommand = new SimpleCommand <object>(OnSaveCommandExecute); }
private IUIMetadata GetUIMetadata(object view, object viewModel) { IUIMetadata uiMetadata = null; var presentable = view as IPresentable; if (presentable != null) { uiMetadata = presentable.UIMetadata; } presentable = viewModel as IPresentable; if (presentable != null) { uiMetadata = presentable.UIMetadata; } return(uiMetadata); }
public FakeView() { UIMetadata = new UIMetadata { LabelProvider = () => "ViewLabel" }; }
public EnumItem(IUIMetadata uiMetadata, TEnum value) { _uiMetadata = uiMetadata; _value = value; }