<Ui>
  <Frame name="AuctionatorBuyFrameTemplate" mixin="AuctionatorBuyFrameMixin" virtual="true">
    <Scripts>
      <OnEvent method="OnEvent"/>
      <OnShow method="OnShow"/>
      <OnHide method="OnHide"/>
    </Scripts>
    <Size x="450" y="350" />
    <Frames>
      <Frame parentKey="SearchDataProvider" mixin="AuctionatorBuyAuctionsDataProviderMixin">
        <Scripts>
          <OnLoad method="OnLoad"/>
          <OnUpdate method="OnUpdate" />
        </Scripts>
      </Frame>

      <Frame parentKey="HistoryDataProvider" mixin="AuctionatorBuyingHistoricalPriceProviderMixin">
        <Scripts>
          <OnLoad method="OnLoad"/>
          <OnUpdate method="OnUpdate" />
        </Scripts>
      </Frame>

      <Frame parentKey="SearchResultsListing" inherits="AuctionatorResultsListingTemplate">
        <Anchors>
          <Anchor point="TOPLEFT"/>
          <Anchor point="BOTTOMRIGHT" x="-20"/>
        </Anchors>
      </Frame>

      <Frame parentKey="HistoryResultsListing" inherits="AuctionatorResultsListingTemplate" hidden="true">
        <Anchors>
          <Anchor point="TOPLEFT"/>
          <Anchor point="BOTTOMRIGHT" x="-20"/>
        </Anchors>
      </Frame>

      <Frame parentKey="Inset" inherits="AuctionatorInsetTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeKey="$parent.SearchResultsListing" relativePoint="TOPLEFT" x="-10" y="-25"/>
          <Anchor point="BOTTOMRIGHT" relativeKey="$parent.SearchResultsListing" relativePoint="BOTTOMRIGHT" y="2"/>
        </Anchors>
      </Frame>

      <Button inherits="UIPanelDynamicResizeButtonTemplate" text="AUCTIONATOR_L_HISTORY" parentKey="HistoryButton">
        <Anchors>
          <Anchor point="TOP" relativeKey="$parent.SearchResultsListing" relativePoint="BOTTOM"/>
          <Anchor point="LEFT" x="-8" y="10" />
        </Anchors>
        <Scripts>
          <OnClick>
            self:GetParent():ToggleHistory()
          </OnClick>
        </Scripts>
      </Button>

      <Button inherits="UIPanelDynamicResizeButtonTemplate" text="CANCEL_AUCTION" parentKey="CancelButton">
        <Anchors>
          <Anchor point="TOP" relativeKey="$parent.SearchResultsListing" relativePoint="BOTTOM"/>
          <Anchor point="RIGHT" relativePoint="RIGHT" x="-8" y="10" />
        </Anchors>
        <Scripts>
          <OnClick>
            self:GetParent():CancelFocussed()
          </OnClick>
        </Scripts>
      </Button>

      <Button inherits="UIPanelButtonTemplate" text="AUCTIONATOR_L_BUY" parentKey="BuyButton">
        <Anchors>
          <Anchor point="LEFT" relativePoint="LEFT" relativeKey="$parent.CancelButton" x="-100"/>
          <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMLEFT" relativeKey="$parent.CancelButton"/>
        </Anchors>
        <Scripts>
          <OnClick>
            self:GetParent():BuyClicked()
          </OnClick>
        </Scripts>
      </Button>
      <Button inherits="UIPanelDynamicResizeButtonTemplate" text="AUCTIONATOR_L_REFRESH" parentKey="RefreshButton">
        <Anchors>
          <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMLEFT" relativeKey="$parent.BuyButton"/>
        </Anchors>
        <Scripts>
          <OnClick>
            self:GetParent().SearchDataProvider:RefreshQuery()
          </OnClick>
        </Scripts>
      </Button>
      <Frame parentKey="BuyDialog" inherits="AuctionatorBuyDialogTemplate" />
    </Frames>
  </Frame>

  <Frame name="AuctionatorBuyFrameTemplateForShopping" hidden="true" inherits="AuctionatorBuyFrameTemplate" mixin="AuctionatorBuyFrameMixinForShopping" virtual="true">
    <Scripts>
      <OnLoad method="Init"/>
    </Scripts>
    <Anchors>
      <Anchor point="TOPLEFT" relativeKey="$parent.ResultsListing" y="-50"/>
      <Anchor point="BOTTOMRIGHT"/>
    </Anchors>
    <Frames>
      <Button inherits="UIPanelDynamicResizeButtonTemplate" text="BACK" parentKey="ReturnButton">
        <Anchors>
          <Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" relativeKey="$parent.SearchResultsListing" y="10" />
        </Anchors>
        <Scripts>
          <OnClick>
            self:GetParent():Hide()
          </OnClick>
        </Scripts>
      </Button>

      <Frame mixin="AuctionatorBuyingItemTooltipMixin" enableMouse="true">
        <Scripts>
          <OnLoad method="OnLoad"/>
          <OnEnter method="OnEnter"/>
          <OnLeave method="OnLeave"/>
          <OnMouseUp method="OnMouseUp"/>
        </Scripts>
        <Anchors>
            <Anchor point="TOP" y="-9"/>
            <Anchor point="LEFT" relativeKey="$parent.ReturnButton" relativePoint="RIGHT"/>
        </Anchors>
        <Layers>
          <Layer>
            <Texture parentKey="Icon">
              <Size x="40" y="40"/>
              <Anchors>
                  <Anchor point="TOP" y="-10"/>
                  <Anchor point="LEFT" x="15"/>
              </Anchors>
            </Texture>
            <MaskTexture parentKey="IconMask" file="Interface\Common\common-iconmask" hWrapMode="CLAMPTOBLACKADDITIVE" vWrapMode="CLAMPTOBLACKADDITIVE">
              <Anchors>
                <Anchor point="TOPLEFT" relativeKey="$parent.Icon" />
                <Anchor point="BOTTOMRIGHT" relativeKey="$parent.Icon" />
              </Anchors>
              <MaskedTextures>
                <MaskedTexture childKey="Icon"/>
              </MaskedTextures>
            </MaskTexture>
            <FontString parentKey="Text" text="Item text" inherits="GameFontHighlight" justifyH="LEFT">
              <Size x="400" y="50"/>
              <Anchors>
                <Anchor point="TOP" y="-5"/>
                <Anchor point="LEFT" x="65"/>
              </Anchors>
            </FontString>
          </Layer>
        </Layers>
      </Frame>
    </Frames>
  </Frame>

  <Frame name="AuctionatorBuyFrameTemplateForSelling" inherits="AuctionatorBuyFrameTemplate" mixin="AuctionatorBuyFrameMixinForSelling" virtual="true" />
</Ui>
