<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx"
               creationComplete="application1_creationCompleteHandler(event)" 
               xmlns:components="com.unitedmindset.views.components.*"
               initialize="application1_initializeHandler(event)" viewSourceURL="srcview/index.html">
    <fx:Script>
        <![CDATA[
            import com.unitedmindset.managers.DeepLinkingManager;
            
            import mx.events.FlexEvent;
            import mx.events.IndexChangedEvent;

            protected function application1_creationCompleteHandler(event:FlexEvent):void
            {
            }


            protected function viewstack1_changeHandler(event:IndexChangedEvent):void
            {
                DeepLinkingManager.getInstance().updateUrl();
            }


            protected function application1_initializeHandler(event:FlexEvent):void
            {
                DeepLinkingManager.getInstance().init("","Deep Linking Example", this, null, DeepLinkingManager.phpStyleParseFunction);
                DeepLinkingManager.getInstance().registerNavigationControl("main", viewstack1, "selectedIndex");
            }

        ]]>
    </fx:Script>
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:layout>
        <s:VerticalLayout gap="20" paddingBottom="20" paddingLeft="20" paddingRight="20" paddingTop="20"/>
    </s:layout>
    <s:ButtonBar dataProvider="{viewstack1}"/>
    <mx:ViewStack id="viewstack1" width="100%" height="100%" change="viewstack1_changeHandler(event)">
        <s:NavigatorContent label="View 1" width="100%" height="100%" backgroundColor="#3EA74B">
            <s:Label text="View 1" horizontalCenter="0" verticalCenter="0" fontSize="20" fontWeight="bold"/>
            <components:CustomComponent />
        </s:NavigatorContent>
        <s:NavigatorContent label="View 2" width="100%" height="100%" backgroundColor="#3554AB">
            <s:Label text="View 2" horizontalCenter="0" verticalCenter="0" fontSize="20" fontWeight="bold"/>
            <components:CustomList />
        </s:NavigatorContent>
        <s:NavigatorContent label="View 3" width="100%" height="100%" backgroundColor="#B63131">
            <s:Label text="View 3" horizontalCenter="0" verticalCenter="0" fontSize="20" fontWeight="bold"/>
        </s:NavigatorContent>
    </mx:ViewStack>
</s:Application>