Exemplo n.º 1
0
        public ViewModel(Model m)
        {
            WrappedModel = new ModelWrapped(m);

            // Add "proxy" properties
            AllProperties(m);

            // Add dynamic properties
            Property("Total", () => m.Prop1 + m.Prop2);
            Property("Total2", () => WrappedModel.Model.Prop1 + WrappedModel.Model.Prop2);

            // Add dependency for "native" view model property
            Dependency(() => TotalVM, () => WrappedModel.Model.Prop1 + WrappedModel.Model.Prop2);

            // Add Command
            Command("MessageCommand", ShowMessage, (o) => m.Prop1 > 5);
        }
Exemplo n.º 2
0
        public ViewModel(Model m)
        {
            WrappedModel = new ModelWrapped(m);

            // Add "proxy" properties
            AllProperties(m);

            // Add dynamic properties
            Property("Total", () => m.Prop1 + m.Prop2);
            Property("Total2", () => WrappedModel.Model.Prop1 + WrappedModel.Model.Prop2);

            // Add dependency for "native" view model property
            Dependency(() => TotalVM, () => WrappedModel.Model.Prop1 + WrappedModel.Model.Prop2);

            // Add Command
            Command("MessageCommand", ShowMessage, (o) => m.Prop1 > 5);
        }