зеркало из https://github.com/xamarin/mac-samples.git
a6577adcdf | ||
---|---|---|
.. | ||
Screenshots | ||
AppDelegate.cs | ||
EditController.cs | ||
Info.plist | ||
LICENSE.txt | ||
Main.cs | ||
MainMenu.xib | ||
MainMenu.xib.designer.cs | ||
Metadata.xml | ||
NSTableViewBinding.csproj | ||
NSTableViewBinding.sln | ||
README.md | ||
TableEdit.cs | ||
TableEdit.xib | ||
TableEdit.xib.designer.cs | ||
TestWindow.cs | ||
TestWindow.xib | ||
TestWindow.xib.designer.cs | ||
TestWindowController.cs |
README.md
name | description | page_type | languages | products | urlFragment | ||
---|---|---|---|---|---|---|---|
Xamarin.Mac - NSTableViewBinding | NSTableViewBinding is an application that demonstrates how to use Cocoa Bindings with a NSTableView. It demonstrates how to setup bindings in both... | sample |
|
|
nstableviewbinding |
NSTableViewBinding
NSTableViewBinding is an application that demonstrates how to use Cocoa Bindings with a NSTableView
.
It demonstrates how to setup bindings in both Interface Builder or programatically.
The compile directive flag "USE BINDINGS BY CODE" defined in the projects's Options will instruct the compiler to build code that establishes the very same bindings created in Interface Builder.
Of course, to set this flag will mean that these bindings setup in Interface Builder will not be necessary and become redundant.
NSArrayController
drives the content for each table column.NSArrayController
drives the table's current selection.- Provides table row double-click inspection.
- Proper enabling/disabling of buttons based on the table's current selection.
NSArrayController
drives the content of severalNSTextFields
based on the controller's selection.- Provides notification of table selection changes through the use of
observeValueForKeyPath
.
Steps for setting the Compiler Directive "USE BINDINGS BY CODE"
Running example with code binding:
- From the MonoDevelop Menu select Project -> NSTableViewBinding Options.
- The project options panel will be be opened.
- Under the category Build -> Compiler look for the field labeled Define Symbols half way down the panel page.
- Add the symbol "USE BINDINGS BY CODE"
Steps for un-setting the Compiler Directive "USE BINDINGS BY CODE"
Running example without code binding where the bindings are established in Interface Builder:
- From the MonoDevelop Menu select Project -> NSTableViewBinding Options.
- The project options panel will be be opened.
- Under the category Build -> Compiler look for the field labeled Define Symbols half way down the panel page.
- Make sure the symbol "USE BINDINGS BY CODE" is not in this field.
Instructions
- Use the Add and Remove buttons (small square buttons marked with "+" and "-") to add and remove people from the table.
- You can edit each person's info by changing the first, last, and phone text fields.
- By double-clicking a row in the table can also alternately edit a given person through the use of a sheet window.
Copyright
Xamarin port changes are released under the MIT license
Author
Ported to Xamarin.Mac by Kenneth J. Pouncey.