зеркало из https://github.com/xamarin/mac-samples.git
51 строка
1.2 KiB
C#
51 строка
1.2 KiB
C#
// This file has been autogenerated from a class added in the UI designer.
|
|
|
|
using System;
|
|
|
|
using Foundation;
|
|
using AppKit;
|
|
|
|
namespace MacDatabinding
|
|
{
|
|
public partial class SimpleViewController : NSViewController
|
|
{
|
|
#region Private Variables
|
|
private PersonModel _person = new PersonModel();
|
|
#endregion
|
|
|
|
#region Computed Properties
|
|
[Export("Person")]
|
|
public PersonModel Person {
|
|
get {return _person; }
|
|
set {
|
|
WillChangeValue ("Person");
|
|
_person = value;
|
|
DidChangeValue ("Person");
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region Constructors
|
|
public SimpleViewController (IntPtr handle) : base (handle)
|
|
{
|
|
}
|
|
#endregion
|
|
|
|
#region Override Methods
|
|
public override void ViewDidLoad ()
|
|
{
|
|
base.ViewDidLoad ();
|
|
|
|
// Set a default person
|
|
var Craig = new PersonModel ("Craig Dunn", "Documentation Manager");
|
|
Craig.AddPerson (new PersonModel ("Amy Burns", "Technical Writer"));
|
|
Craig.AddPerson (new PersonModel ("Joel Martinez", "Web & Infrastructure"));
|
|
Craig.AddPerson (new PersonModel ("Kevin Mullins", "Technical Writer"));
|
|
Craig.AddPerson (new PersonModel ("Mark McLemore", "Technical Writer"));
|
|
Craig.AddPerson (new PersonModel ("Tom Opgenorth", "Technical Writer"));
|
|
Person = Craig;
|
|
}
|
|
#endregion
|
|
}
|
|
}
|