implement get/set for selectedBackgroundColor property (#4039)

* implement get/set for selectedBackgroundColor property

* list-view separator color exposed through style

* Style androidStatusBarBackground exposed on Page
This commit is contained in:
Hristo Hristov
2017-04-21 17:57:25 +03:00
committed by GitHub
parent c7c0ea7ca4
commit 25849a1425
5 changed files with 25 additions and 7 deletions

View File

@@ -40,11 +40,17 @@ export abstract class ListViewBase extends View implements ListViewDefinition {
public _itemTemplatesInternal = new Array<KeyedTemplate>(this._defaultTemplate);
public _effectiveRowHeight: number = autoEffectiveRowHeight;
public rowHeight: Length;
public separatorColor: Color;
public items: any[] | ItemsSource;
public itemTemplate: string | Template;
public itemTemplates: string | Array<KeyedTemplate>;
get separatorColor(): Color {
return this.style.separatorColor;
}
set separatorColor(value: Color) {
this.style.separatorColor = value;
}
get itemTemplateSelector(): string | ((item: any, index: number, items: any) => string) {
return this._itemTemplateSelector;
}

View File

@@ -35,7 +35,6 @@ export class PageBase extends ContentView implements PageDefinition {
public actionBarHidden: boolean;
public enableSwipeBackNavigation: boolean;
public backgroundSpanUnderStatusBar: boolean;
public androidStatusBarBackground: Color;
constructor() {
super();
@@ -83,6 +82,13 @@ export class PageBase extends ContentView implements PageDefinition {
this.style.statusBarStyle = value;
}
public get androidStatusBarBackground(): Color {
return this.style.androidStatusBarBackground;
}
public set androidStatusBarBackground(value: Color) {
this.style.androidStatusBarBackground = value;
}
get page(): PageDefinition {
return this;
}

View File

@@ -291,4 +291,4 @@ export const statusBarStyleProperty: CssProperty<Style, "light" | "dark">;
/**
* Property backing androidStatusBarBackground.
*/
export const androidStatusBarBackgroundProperty: Property<Page, Color>;
export const androidStatusBarBackgroundProperty: CssProperty<Style, Color>;

View File

@@ -31,8 +31,14 @@ export abstract class SegmentedBarBase extends View implements SegmentedBarDefin
public static selectedIndexChangedEvent = "selectedIndexChanged";
public selectedIndex: number;
public selectedBackgroundColor: Color;
public items: Array<SegmentedBarItemDefinition>;
public get selectedBackgroundColor(): Color {
return this.style.selectedBackgroundColor;
}
public set selectedBackgroundColor(value: Color) {
this.style.selectedBackgroundColor = value;
}
public _addArrayFromBuilder(name: string, value: Array<any>): void {
if (name === "items") {

View File

@@ -6,7 +6,7 @@
import {
ViewBase, View, AddChildFromBuilder, AddArrayFromBuilder,
Property, CoercibleProperty, EventData, Color
Property, CoercibleProperty, EventData, Color, CssProperty, Style
} from "../core/view";
/**
@@ -88,9 +88,9 @@ export const selectedIndexProperty: CoercibleProperty<SegmentedBar, number>;
/**
* Gets or sets the selected background color property of the SegmentedBar.
*/
export const selectedBackgroundColorProperty: Property<SegmentedBar, Color>;
export const selectedBackgroundColorProperty: CssProperty<Style, Color>;
/**
* Gets or sets the items dependency property of the SegmentedBar.
*/
export const itemsProperty: Property<SegmentedBar, SegmentedBarItem[]>;
export const itemsProperty: Property<SegmentedBar, SegmentedBarItem[]>;