<mvc:View
    id="contentFinderDialogView"
    xmlns="sap.m"
    xmlns:core="sap.ui.core"
    xmlns:mvc="sap.ui.core.mvc"
    height="100%"
    controllerName="sap.ushell.components.contentFinder.controller.ContentFinderDialog"
    core:require="{ formatMessage: 'sap/base/strings/formatMessage' }">
    <Dialog
        id="contentFinderDialog"
        contentWidth="64.5rem"
        contentHeight="80%"
        resizable="true"
        closeOnNavigation="true"
        class="sapUiNoContentPadding"
        horizontalScrolling="false"
        verticalScrolling="false"
        afterClose=".onClose">
        <customHeader>
            <OverflowToolbar id="contentFinderHeaderToolbar">
                <Button
                    id="contentFinderBackButton"
                    icon="sap-icon://nav-back"
                    visible="{= ${/activeNavigationTarget} !== ${/navigationTargets/widgetGallery} &amp;&amp; !${/restrictedMode}}"
                    press=".onBackButtonPressed" />
                <Title
                    id="headerTitle"
                    text="{
                    parts: [
                        '/activeNavigationTarget'
                    ], formatter: '.formatter.formatDialogTitle' }" />
                <ToolbarSpacer />
            </OverflowToolbar>
        </customHeader>

        <content>
            <NavContainer id="contentFinderNavContainer">
                <Page
                    id="contentFinderWidgetGalleryPage"
                    enableScrolling="false"
                    showHeader="false">
                    <mvc:XMLView
                        id="contentFinderWidgetGalleryView"
                        async="true"
                        height="100%"
                        viewName="sap.ushell.components.contentFinder.view.WidgetGallery" />
                </Page>
                <Page
                    id="contentFinderAppSearchPage"
                    enableScrolling="false"
                    showHeader="false">
                    <mvc:XMLView
                        id="contentFinderAppSearchView"
                        async="true"
                        height="100%"
                        viewName="sap.ushell.components.contentFinder.view.AppSearch" />
                </Page>
            </NavContainer>
        </content>
        <beginButton>
            <Button
                id="contentFinderAddButton"
                type="Emphasized"
                visible="{
                        parts: [
                            '/activeNavigationTarget'
                        ], formatter: '.formatter.addButtonIsVisibleInAppSearch' }"
                text="{parts: [{path: 'i18n>ContentFinder.Button.Add'}, {path: '/appSearch/selectedAppCount'}],
                    formatter: 'formatMessage' }"
                enabled="{= ${/appSearch/selectedAppCount} > 0}"
                press=".onAddButtonPressed" />
        </beginButton>
        <endButton>
            <Button
                id="contentFinderCancelButton"
                text="{i18n>ContentFinder.Button.Cancel}"
                press=".onCancelButtonPressed" />
        </endButton>
    </Dialog>
</mvc:View>
