Skip to content

Commit

Permalink
Fix the styling of the paragraphs
Browse files Browse the repository at this point in the history
Fixes issue NativeScript#227
  • Loading branch information
ErjanGavalji committed Feb 15, 2016
1 parent 20162e9 commit 3e0b280
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion core-concepts/bindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ for(i = 0; i < 5; i++) {
}
source.set("items", list);
```
###Binding to a Parent Binding Context
###Binding to a Parent Binding Context

Another common case in working with bindings is requesting access to the parent binding context. It is because it might be different from the bindingContext of the child and might contain information, which the child has to use. Generally, the bindingContext is inheritable, but not when the elements (items) are created dynamically based on some data source. For example, `ListView` creates its child items based on an `itemТemplate`, which describes how the `ListView` element will look like. When this element is added to the visual tree, it gets for binding context an element from ListView `items` array (with the corresponding index). This process creates a new binding context chain for the child item and its inner UI elements. So, no inner UI element cannot access binding context of the `ListView`. In order to solve this problem NativeScript binding infrastructure has two special keywords `$parent` and `$parents`. While the first one denotes the binding context of the direct parent visual element, the second one can be used as an array (with number or string index). This gives the option to choose either `N` levels of UI nesting or get a parent UI element with a given type. Let's see how this works in a real case example.

Expand Down
14 changes: 7 additions & 7 deletions core-concepts/properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ NativeScript features two types of properties: **dependency properties** and **s

This sections includes these topics:

<a id = "intro1"></a>### Introduction
###<a id = "intro1"></a>Introduction

Dependency properties provide valuable features that simplify the creation of a rich User Interface (UI), including:

Expand All @@ -75,7 +75,7 @@ Dependency properties provide valuable features that simplify the creation of a
* Change notification&mdash;Another callback function is called when the property value changes. It is called with an [EventData]({{site.baseurl}}/ApiReference/data/observable/EventData.md) as parameter.
* Inheritance&mdash;One of the most important features of dependency properties is inheritance. It is implemented through a dedicated UI element that allows it to get its property from a parent element in the visual tree. For example, a button can inherit its style (or theme) property value from the parent Window, Layout, or another container. This gives you the option to dramatically change the look of your entire application by only changing a single setting (Window.theme).

<a id = declaring></a>### Declaring a Dependency Property
###<a id = declaring></a>Declaring a Dependency Property

Only classes that derive from [DependencyObservable]({{site.baseurl}}/ApiReference/ui/core/dependency-observable/DependencyObservable.md) can have a dependency property. This class has built-in methods that support the entire infrastructure of dependency properties.

Expand Down Expand Up @@ -124,7 +124,7 @@ export class MyClass extends dependencyObservable.DependencyObservable {
}
}
```
<a id = "changedCallback"></a>### Adding a Changed Callback
###<a id = "changedCallback"></a>Adding a Changed Callback

The following code example demonstrates how to implement the functionality of changing a notification. It adds a callback function `onMyPropertyChanged` that prints a message about a change in a property.

Expand Down Expand Up @@ -188,7 +188,7 @@ export class MyClass extends dependencyObservable.DependencyObservable {
}
```

<a id = "validationCallback"></a>### Adding a Validation Callback
###<a id = "validationCallback"></a>Adding a Validation Callback

The following code example demonstrates how to implement Value validation. It adds a callback function `validateMyProperty` that takes the new property value and validates it using a simple rule.

Expand Down Expand Up @@ -231,7 +231,7 @@ export var myPropertyProperty = new dependencyObservable.Property(
...
```
<a id = "inheritable"></a>### Creating an Inheritable Dependency Property
###<a id = "inheritable"></a>Creating an Inheritable Dependency Property
The following code example demonstrates how to create an inheritable dependency property:
Expand Down Expand Up @@ -284,11 +284,11 @@ export class MyClass extends dependencyObservable.DependencyObservable {
## Style Properties
<a id = "intro2"></a>### Introduction
###<a id = "intro2"></a>Introduction
Probably the best use case for inheritable properties is applying different styles and themes to UI components. You only need to set a property (theme or style) to the base-most container and every single UI component inherits it through the visual tree.
<a id = "setting"></a>### Setting a Style Property
###<a id = "setting"></a>Setting a Style Property
Setting a style property is similar to setting a regular property but you use the nested `style` object (that is a property of the View class which means that every UI component has style).
Expand Down

0 comments on commit 3e0b280

Please sign in to comment.