import { EventData } from "tns-core-modules/data/observable";
import { Button } from "tns-core-modules/ui/button";
import { TabView, SelectedIndexChangedEventData } from "tns-core-modules/ui/tab-view";

export function onSelectedIndexChanged(args: SelectedIndexChangedEventData) {
    const tabView = args.object as TabView;
    
    const newItem = tabView.items[args.newIndex];
    if (newItem) {
        newItem.iconSource = "res://icon";
    }

    const oldItem = tabView.items[args.oldIndex];
    if (oldItem) {
        oldItem.iconSource = "res://testlogo";
    }
}
