CSLA.NET 5.4.2
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
ViewControllerBase.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="ActivityBase.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>CSLA helper to be used in place of the normal Xamarin Android activity that contains a reference to a CSLA ViewModel and a BindingManager</summary>
7//-----------------------------------------------------------------------
8
9using Csla.Iosui.Binding;
12#if __UNIFIED__
13using UIKit;
14#else
15using MonoTouch.UIKit;
16#endif
17
18namespace Csla.Iosui
19{
25 public abstract class ViewControllerBase<T, Z> : UIViewController where T : ViewModel<Z>
26 {
30 protected T viewModel = null;
31
35 protected BindingManager Bindings = null;
36
41 protected byte[] SerilizeModelForParameter()
42 {
43 return this.SerilizeModelForParameter(this.viewModel.Model);
44 }
45
51 protected byte[] SerilizeModelForParameter(object model)
52 {
53 return SerializationFormatterFactory.GetFormatter().Serialize(model);
54 }
55
61 protected object DeserializeFromParameter(byte[] parameter)
62 {
63 return SerializationFormatterFactory.GetFormatter().Deserialize(parameter);
64 }
65 }
66}
Provides the ability to bing properties on iOS UI controls to properties on CSLA objects.
CSLA helper to be used in place of the normal Xamarin Android activity that contains a reference to a...
byte[] SerilizeModelForParameter()
Serializes the ViewModel's model property using the SerializationFormatterFactory....
object DeserializeFromParameter(byte[] parameter)
Takes a byte array and uses the MobileFormatter to reconstitute it into a model reference.
byte[] SerilizeModelForParameter(object model)
Serialized the provided model using the SerializationFormatterFactory.GetFormatter().
BindingManager Bindings
The BindingManager for this Activity.
T viewModel
A reference to the view model.