<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
    
    <Frame name="GwBagMoverFrame" frameStrata="HIGH" frameLevel="5" enableMouse="true" movable="true" parent="UIParent" virtual="true">
        <Size x="470" y="40"></Size>
       <Anchors>
            <Anchor point="RIGHT" x="-256" y="256"></Anchor>
        </Anchors>
        <Scripts>
            <OnLoad>
                self:RegisterForDrag("LeftButton");
            </OnLoad>

              <OnDragStart>self:StartMoving();</OnDragStart>
              <OnDragStop>self:StopMovingOrSizing();
                  
                  
                  if self:GetName()~='GwBagMoverFrame' then return end
                  local saveBagPos = {}
                  saveBagPos['point'], _, saveBagPos['relativePoint'], saveBagPos['xOfs'] , saveBagPos['yOfs'] = self:GetPoint()
  
                  
                  gwSetSetting('BAG_POSITION',saveBagPos)
            </OnDragStop>
        </Scripts>
        
    </Frame>
    <Frame name="GwBankFrame" frameStrata="HIGH" frameLevel="2" enableMouse="true"  parent="UIParent" virtual="true">
        <HitRectInsets>
             <AbsInset left="-40" right="0" top="0" bottom="-40"/>
        </HitRectInsets>
        <Size x="768" y="512"></Size>
        <Anchors>
            <Anchor point="TOPLEFT" relativeTo="GwBankMoverFrame" relativePoint="TOPLEFT" x="20" y="-40"></Anchor>
        </Anchors>
        <Layers>
            <Layer level="BACKGROUND">
                <Texture name="$parentBackground" file="Interface\AddOns\GW2_UI\textures\bag\bankbg">
                    <Size x="768" y="512"></Size>
                    <Anchors>
                        <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" x="0" y="0" />
                        <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="0" y="0" />
                        <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                        <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="0" y="0" />
                    </Anchors>
                </Texture>
              <Texture name="$parentHeader" file="Interface\AddOns\GW2_UI\textures\bag\bagheader">
                    <Size x="512" y="64"></Size>
                    <Anchors>
                        <Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                    </Anchors>
                </Texture>
                <Texture name="$parentHeader" file="Interface\AddOns\GW2_UI\textures\bag\bagheader-right">
                    <Size x="512" y="64"></Size>
                    <Anchors>
                        <Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" x="0" y="0" />
                    </Anchors>
                </Texture>

                <Texture name="$parentFooter" file="Interface\AddOns\GW2_UI\textures\bag\bagfooter">
                    <Size x="512" y="70"></Size>
                    <Anchors>
                        <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" x="0" y="2" />
                        <Anchor point="TOPRIGHT" relativePoint="BOTTOMRIGHT" x="0" y="2" />
                    </Anchors>
                </Texture>
                <Texture name="$parentLeft" file="Interface\AddOns\GW2_UI\textures\bag\bagleftpanel">
                    <Size x="40" y="512"></Size>
                    <Anchors>
                        <Anchor point="TOPRIGHT" relativePoint="TOPLEFT" x="0" y="0" />
                        <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMLEFT" x="0" y="0" />
                    </Anchors>
                </Texture>               
                
            </Layer>
    
            <Layer textureSubLevel="3">
                <Texture name="$parentHeader" file="Interface\AddOns\GW2_UI\textures\bag\bagicon">
                    <Size x="128" y="128"></Size>
                    <Anchors>
                        <Anchor point="CENTER" relativePoint="TOPLEFT" x="-16" y="16" />
                    </Anchors>
                </Texture>
                 <Texture  file="Interface\AddOns\GW2_UI\textures\bag\bottom-right">
                    <Size x="128" y="128"></Size>
                    <Anchors>
                        <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="0" y="0" />
                    </Anchors>
                </Texture>
                <FontString name="$parentHeaderString" text="Bank" inherits="GameFontNormalSmall" justifyH="LEFT">
                <Size x="512" y="40"></Size>
                <Color r="1" b="0.73" g="0.93"></Color>
                <Anchors>
                    <Anchor point="TOPLEFT" x="30" y="40"></Anchor>
                </Anchors>
            </FontString>
            
            <FontString name="$parentBagSpaceString" text="100/100" inherits="GameFontNormalSmall" justifyH="LEFT">
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="8" y="-8" />
                </Anchors>
                <Size x="200" y="24" />
            </FontString>
          
                
            </Layer>

        </Layers>
        <Scripts>
            <OnLoad>
                
                GwBankFrameBagSpaceString:SetFont(UNIT_NAME_FONT,12)
                GwBankFrameBagSpaceString:SetTextColor(255/255,255/255,255/255)
                GwBankFrameBagSpaceString:SetShadowColor(0,0,0,0)
                                
                GwBankFrameHeaderString:SetFont(DAMAGE_TEXT_FONT,24)
                
               self:RegisterEvent('PLAYER_MONEY')
               GwBankFrameHeaderString:SetFont(DAMAGE_TEXT_FONT,24)
                
             
                
                
            </OnLoad>

        </Scripts>

        <Frames>
            <Frame name="GwBuyMoreBank" virtual="true">
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" x="0" y="-5"></Anchor>
                </Anchors>
                <Size x="200" y="40"></Size> 
                <Layers>
                    <Layer>
                    <FontString name="GwBuyMoreBankGold" text="100" inherits="GameFontNormalSmall" justifyH="RIGHT">
                        <Size x="50" y="40"></Size>
                        <Anchors>
                            <Anchor point="LEFT" relativeTo="GwButtonBuyBankSlots" relativePoint="RIGHT" x="0" y="0"></Anchor>
                        </Anchors>
                    </FontString>
                    <Texture name="GwBuyMoreBankGoldIcon" file="Interface\MoneyFrame\UI-GoldIcon">
                        <Size x="11" y="11"></Size>
                        <Anchors>
                            <Anchor point="LEFT" relativeTo="GwBuyMoreBankGold" relativePoint="RIGHT" x="0" y="0"></Anchor>
                        </Anchors>
                    </Texture>
                    </Layer>
                </Layers>
                <Frames>
                    <Button name="GwButtonBuyBankSlots" inherits="GwStandardButton" text="Purchase More Slots">
                        <Size x="158" y="32" />
                        <Anchors>
                            <Anchor point="LEFT" relativePoint="LEFT" relativeTo="GwBuyMoreBank" x="5" y="5"></Anchor>
                        </Anchors>
                        <Scripts>
                            <OnClick>
                                PurchaseSlot()                                
                            </OnClick>
							<OnLoad>
								self:SetText(GwLocalization['BANK_BUY_SLOTS'])
							</OnLoad>
                        </Scripts>
                    </Button>
                </Frames>
                <Scripts>
                    <OnEvent>
                        if GetNumBankSlots()==7 then
                            GwBuyMoreBank:Hide()
                        end
                        local cost = GetBankSlotCost()/100/100
                        GwBuyMoreBankGold:SetText(cost)
                    </OnEvent>
                    <OnLoad>
                        if GetNumBankSlots()==7 then
                            GwBuyMoreBank:Hide()
                        end
                        local cost = GetBankSlotCost()/100/100
                        GwBuyMoreBankGold:SetText(cost)
                        GwBuyMoreBank:RegisterEvent('PLAYERBANKBAGSLOTS_CHANGED');
                        GwBuyMoreBankGold:ClearAllPoints()
                        GwBuyMoreBankGold:SetPoint('LEFT',GwButtonBuyBankSlots,'RIGHT',20,0)
           
                                     
                        GwBuyMoreBankGold:SetFont(UNIT_NAME_FONT,12)
                        GwBuyMoreBankGold:SetTextColor(221/255,187/255,68/255)
         
                    </OnLoad>
                </Scripts>
            </Frame>
            <Frame name="GwBankFrameResize" frameStrata="HIGH" frameLevel="5" enableMouse="true" movable="true" parent="UIParent" virtual="true">
                <Size x="40" y="40"></Size>
                <Anchors>
                    <Anchor point="BOTTOMRIGHT" relativeTo="GwBankFrame" relativePoint="BOTTOMRIGHT" x="0" y="0"></Anchor>
                </Anchors>
                      <Layers>
                    <Layer level="OVERLAY">
                        <Texture name="$parentTexture" file="Interface\AddOns\GW2_UI\textures\resize">
                           
                            <Size x="32" y="32"></Size>
                            <Anchors>
                                <Anchor point="CENTER" x="0" y="0"></Anchor>
                            </Anchors>
                        </Texture>
                   
                    </Layer>
                </Layers>
                <Scripts>
                    <OnLoad>
                        self:RegisterForDrag("LeftButton");
                    </OnLoad>

                      <OnDragStart>
                          gw_bankOnResizeStart(self)
                          
                        </OnDragStart>
                      <OnDragStop>
                        gw_bankOnResizeStop(self)
                          
                    </OnDragStop>
                </Scripts>

            </Frame>
            <Button name="GwBankButton"  virtual="true">
                <Size x="40" y="40"></Size>
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="-40" y="-20"></Anchor>
                </Anchors>
                <Layers>
                    <Layer level="OVERLAY">
                        <Texture name="$parentTexture" file="Interface\AddOns\GW2_UI\textures\bag\bankicons">
                            <TexCoords left="0" right="1" top="0.5" bottom="1" />
                            <Size x="32" y="32"></Size>
                            <Anchors>
                                <Anchor point="CENTER" x="0" y="0"></Anchor>
                            </Anchors>
                        </Texture>
                   
                    </Layer>
                </Layers>
                <Scripts>
                    <OnEnter>
                        _G[self:GetName()..'Texture']:SetBlendMode('ADD')
                    </OnEnter>
                    <OnLeave>
                        _G[self:GetName()..'Texture']:SetBlendMode('BLEND')
                    </OnLeave>
                    <OnClick>
                        BankSlotsFrame:Show()
                        ReagentBankFrame:Hide()
                    </OnClick>
                </Scripts>
            </Button>     
            <Button name="GwBankButton2"  virtual="true">
                <Size x="40" y="40"></Size>
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="-40" y="-60"></Anchor>
                </Anchors>
                <Layers>
                    <Layer level="OVERLAY">
                        <Texture name="$parentTexture" file="Interface\AddOns\GW2_UI\textures\bag\bankicons">
                            <TexCoords left="0" right="1" top="0" bottom="0.5" />
                            <Size x="32" y="32"></Size>
                            <Anchors>
                                <Anchor point="CENTER" x="0" y="0"></Anchor>
                            </Anchors>
                        </Texture>
                   
                    </Layer>
                </Layers>
                <Scripts>
                    <OnEnter>
                        _G[self:GetName()..'Texture']:SetBlendMode('ADD')
                    </OnEnter>
                    <OnLeave>
                        _G[self:GetName()..'Texture']:SetBlendMode('BLEND')
                    </OnLeave>
                    <OnClick>
                        BankSlotsFrame:Hide()
                        ReagentBankFrame:Show()
                    </OnClick>
                </Scripts>
            </Button>
            
            <Frame name="GwReagentBankFrame" hidden="true" >
                <Size x="724" y="512"></Size>
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0"></Anchor>
                </Anchors>
                <Layers>
                    <Layer>
                        <FontString name="GwRegentHelpText" text="REAGENT_BANK_HELP">
                            <Anchors>
                                <Anchor point="CENTER" relativePoint="CENTER"></Anchor>
                            </Anchors>
                        </FontString>
                    </Layer>
                </Layers>
                <Frames>
                    <Button name="GwBankDepositAllReagents" hidden="true" inherits="GwStandardButton" text="Deposit All">
                        <Anchors>
                            <Anchor point="TOPLEFT" relativeTo="GwBankFrame" relativePoint="BOTTOMLEFT" y="-5"></Anchor>
                        </Anchors>
                        <Scripts>
                            <OnClick>
                                 DepositReagentBank()
                            </OnClick>
							<OnLoad>
								self:SetText(GwLocalization['REAGENT_BANK_DEPOSIT_ALL'])
							</OnLoad>
                        </Scripts>
                    </Button>
                    <Button name="GwBuyRegentBank" inherits="GwStandardButton" text="Purchase">
                        <Anchors>
                            <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="GwRegentHelpText" x="0" y="-20"></Anchor>
                        </Anchors>
                        <Scripts>
                            <OnClick>
                                BuyReagentBank()                                
                            </OnClick>
                        </Scripts>
                    </Button>
                </Frames>
                <Scripts>
                    <OnLoad>
                        self:RegisterEvent('REAGENTBANK_PURCHASED')
                        GwRegentHelpText:SetFont(UNIT_NAME_FONT,12)
                        GwRegentHelpText:SetShadowColor(1,1,1)
                        BUY_REGENTBAG_TEXT = GwLocalization['PURCHASE_REAGENT_BANK']..((GetReagentBankCost())/100/100)..'G'
                        GwBuyRegentBank:SetText(BUY_REGENTBAG_TEXT)
                        
                        if  IsReagentBankUnlocked() then
                            GwRegentHelpText:Hide()
                            GwBuyRegentBank:Hide()
                            GwBankDepositAllReagents:Show()
                        end
                    </OnLoad>
                    <OnEvent>
                        if  IsReagentBankUnlocked() then
                            GwRegentHelpText:Hide()
                            GwBuyRegentBank:Hide()
                            GwBankDepositAllReagents:Show()
                        end
                    </OnEvent>
                </Scripts>
            </Frame>
            <Button name="GwBankButtonSettings" text="" >
                <Anchors>
                    <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="-8" y="-8" />
                </Anchors>
                <Size x="24" y="24" />
                <Anchors><Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="-10" y="30"/></Anchors>
                <NormalTexture file="Interface\AddOns\GW2_UI\textures\MainMenuMicroButton-Up"></NormalTexture>
                <PushedTexture  file="Interface\AddOns\GW2_UI\textures\MainMenuMicroButton-Down"></PushedTexture >
                <HighlightTexture  file="Interface\AddOns\GW2_UI\textures\MainMenuMicroButton-Down"></HighlightTexture >

                <NormalFont style="ChatBubbleFont"></NormalFont>
                <HighlightFont style="ChatBubbleFont"></HighlightFont>
                <Scripts>
                    <OnClick>
                        if GwBankFrameDropDown:IsShown() then
                            GwBankFrameDropDown:Hide()
                        else
                            GwBankFrameDropDown:Show()
                        end
                    </OnClick>
                </Scripts>
            </Button>
            
                 <Frame name="$parentDropDown" frameStrata="HIGH" hidden="true" frameLevel="8">
                <Size x="110" y="60" ></Size>
                <Anchors>
                    <Anchor point="BOTTOMRIGHT" relativeTO="GwBankButtonSettings" relativePoint="LEFT" y="-5"></Anchor>
                </Anchors>
                <Layers>
                    <Layer level="OVERLAY" textureSubLevel="8">
                        <Texture file="nterface\AddOns\GW2_UI\textures\gwstatusbar" >
                            <Color r="0" b="0" g="0"></Color>
                            <Anchors>
                                <Anchor point="TOP" relativePoint="TOP"></Anchor>
                                <Anchor point="BOTTOM" relativePoint="BOTTOM"></Anchor>
                                <Anchor point="LEFT" relativePoint="LEFT"></Anchor>
                                <Anchor point="RIGHT" relativePoint="RIGHT"></Anchor>
                            </Anchors>
                        </Texture>
                    </Layer>
                </Layers>
                <Frames>
                    <Button text="Sort Bank">
                        <Size x="100" y="30"></Size>
                        <Anchors>
                            <Anchor point="TOP" relativePoint="TOP"></Anchor>
                        </Anchors>
                        <NormalFont style="ChatBubbleFont"></NormalFont>
                        <HighlightFont style="ChatBubbleFont"></HighlightFont>
                        <Scripts>
                            <OnClick>
                                 PlaySound(SOUNDKIT.UI_BAG_SORTING_01);
                                SortBankBags();
                                self:GetParent():Hide()
                            </OnClick>
							<OnLoad>
								self:SetText(GwLocalization['SORT_BANK'])
							</OnLoad>
                        </Scripts>
                    </Button>
                    <Button text="Compact view">
                        <Size x="100" y="30"></Size>
                        <Anchors>
                            <Anchor point="TOP" relativePoint="TOP" y="-30"></Anchor>
                        </Anchors>
                        <NormalFont style="ChatBubbleFont"></NormalFont>
                        <HighlightFont style="ChatBubbleFont"></HighlightFont>
                        <Scripts>
                            <OnClick>
                                self:SetText(gw_bankFrameCompactToggle())
                                self:GetParent():Hide()
                            </OnClick>
                            <OnLoad>
                                if gwGetSetting('BANK_ITEM_SIZE')==45 then
                                    self:SetText(GwLocalization['BANK_COMPACT_ICONS'])
                                else
                                    self:SetText(GwLocalization['BANK_EXPAND_ICONS'])
                                end
                            </OnLoad>
                        </Scripts>
                    </Button>
                </Frames>
            </Frame>
            
            <Button name="GwBagButtonClose" text="" >
                <Size x="20" y="20" />
                <Anchors><Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="-10" y="30"/></Anchors>
                <NormalTexture file="Interface\AddOns\GW2_UI\textures\window-close-button-normal"></NormalTexture>
                <PushedTexture  file="Interface\AddOns\GW2_UI\textures\window-close-button-hover"></PushedTexture >
                <HighlightTexture  file="Interface\AddOns\GW2_UI\textures\window-close-button-hover"></HighlightTexture >

                <NormalFont style="ChatBubbleFont"></NormalFont>
                <HighlightFont style="ChatBubbleFont"></HighlightFont>
                <Scripts>
                    <OnClick>
                        BankFrame:Hide()
                    </OnClick>
                </Scripts>
            </Button>
            <Frame name="GwBankContainer4">
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                </Anchors>
            </Frame>      
            <Frame name="GwBankContainer5">
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                </Anchors>
            </Frame>            
            <Frame name="GwBankContainer6">
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                </Anchors>
            </Frame>            
            <Frame name="GwBankContainer7">
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                </Anchors>
            </Frame>            
            <Frame name="GwBankContainer8">
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                </Anchors>
            </Frame>            
            <Frame name="GwBankContainer9">
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                </Anchors>
            </Frame>  
            <Frame name="GwBankContainer10">
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                </Anchors>
            </Frame>   
            <Frame name="GwBankContainer11">
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                </Anchors>
            </Frame>    
            <Frame name="GwBankContainer12">
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                </Anchors>
            </Frame>
        </Frames>
    </Frame>
    <Frame name="GwBagFrame" frameStrata="HIGH" frameLevel="2" enableMouse="true"  parent="UIParent" virtual="true">
        <HitRectInsets>
             <AbsInset left="-40" right="0" top="0" bottom="-40"/>
        </HitRectInsets>
        <Size x="512" y="512"></Size>
        <Anchors>
            <Anchor point="TOPLEFT" relativeTo="GwBagMoverFrame" relativePoint="TOPLEFT" x="20" y="-40"></Anchor>
        </Anchors>
        <Layers>
            <Layer level="BACKGROUND">
                <Texture name="$parentBackground" parentKey="Texture"  file="Interface\AddOns\GW2_UI\textures\bag\bagbg">
                    <Size x="512" y="512"></Size>
                    <Anchors>
                        <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" x="0" y="0" />
                        <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="0" y="0" />
                        <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                        <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="0" y="0" />
                    </Anchors>
                </Texture>
                <Texture name="$parentHeader" file="Interface\AddOns\GW2_UI\textures\bag\bagheader">
                    <Size x="512" y="64"></Size>
                    <Anchors>
                        <Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                    </Anchors>
                </Texture>
                <Texture name="$parentHeader" file="Interface\AddOns\GW2_UI\textures\bag\bagheader-right">
                    <Size x="512" y="64"></Size>
                    <Anchors>
                        <Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" x="0" y="0" />
                    </Anchors>
                </Texture>

                <Texture name="$parentFooter" file="Interface\AddOns\GW2_UI\textures\bag\bagfooter">
                    <Size x="512" y="70"></Size>
                    <Anchors>
                        <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" x="0" y="2" />
                        <Anchor point="TOPRIGHT" relativePoint="BOTTOMRIGHT" x="0" y="2" />
                    </Anchors>
                </Texture>
                <Texture name="$parentLeft" file="Interface\AddOns\GW2_UI\textures\bag\bagleftpanel">
                    <Size x="40" y="512"></Size>
                    <Anchors>
                        <Anchor point="TOPRIGHT" relativePoint="TOPLEFT" x="0" y="0" />
                        <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMLEFT" x="0" y="0" />
                    </Anchors>
                </Texture>               
                
            </Layer>
    
            <Layer textureSubLevel="3">
                 <Texture  file="Interface\AddOns\GW2_UI\textures\bag\bottom-right">
                    <Size x="128" y="128"></Size>
                    <Anchors>
                        <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="0" y="0" />
                    </Anchors>
                </Texture>
                <Texture name="$parentHeader" file="Interface\AddOns\GW2_UI\textures\bag\bagicon">
                    <Size x="128" y="128"></Size>
                    <Anchors>
                        <Anchor point="CENTER" relativePoint="TOPLEFT" x="-16" y="16" />
                    </Anchors>
                </Texture>
                <FontString name="$parentHeaderString" text="Inventory" inherits="GameFontNormalSmall" justifyH="LEFT">
                <Size x="512" y="40"></Size>
                <Color r="1" b="0.73" g="0.93"></Color>
                <Anchors>
                    <Anchor point="TOPLEFT" x="30" y="40"></Anchor>
                </Anchors>
            </FontString>
            
            <FontString name="$parentBagSpaceString" text="100/100" inherits="GameFontNormalSmall" justifyH="LEFT">
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="8" y="-8" />
                </Anchors>
                <Size x="200" y="24" />
            </FontString>
                
            <FontString name="$parentBronze" text="100" inherits="GameFontNormalSmall" justifyH="RIGHT">
                <Size x="100" y="40"></Size>
                 <Anchors>
                    <Anchor point="BOTTOMRIGHT" x="-20" y="-40"></Anchor>
                </Anchors>
            </FontString>
            <Texture name="$parentBronzeTexture" file="Interface\MoneyFrame\UI-CopperIcon">
                <Size x="11" y="11"></Size>
                 <Anchors>
                    <Anchor point="BOTTOMRIGHT" x="-8" y="-25"></Anchor>
                </Anchors>
            </Texture>
            <FontString name="$parentSilver" text="100" inherits="GameFontNormalSmall" justifyH="RIGHT">
                <Size x="100" y="40"></Size>
                 <Anchors>
                    <Anchor point="BOTTOMRIGHT" x="-60" y="-40"></Anchor>
                </Anchors>
            </FontString>
            <Texture name="$parentSilverTexture" file="Interface\MoneyFrame\UI-SilverIcon">
                <Size x="11" y="11"></Size>
                 <Anchors>
                    <Anchor point="BOTTOMRIGHT" x="-48" y="-25"></Anchor>
                </Anchors>
            </Texture> 
                
            <FontString name="$parentGold" text="100" inherits="GameFontNormalSmall" justifyH="RIGHT">
                <Size x="100" y="40"></Size>
                 <Anchors>
                    <Anchor point="BOTTOMRIGHT" x="-100" y="-40"></Anchor>
                </Anchors>
            </FontString>
            <Texture name="$parentGoldTexture" file="Interface\MoneyFrame\UI-GoldIcon">
                <Size x="11" y="11"></Size>
                 <Anchors>
                    <Anchor point="BOTTOMRIGHT" x="-88" y="-25"></Anchor>
                </Anchors>
            </Texture> 
                
                
                
            <FontString name="$parentCurrency1" text="100" inherits="GameFontNormalSmall" justifyH="RIGHT">
                <Size x="100" y="40"></Size>
                 <Anchors>
                    <Anchor point="BOTTOMRIGHT" x="-165" y="-40"></Anchor>
                </Anchors>
            </FontString>
            <Texture name="$parentCurrency1Texture" file="Interface\MoneyFrame\UI-GoldIcon">
                <Size x="11" y="11"></Size>
                 <Anchors>
                    <Anchor point="BOTTOMRIGHT" x="-153" y="-25"></Anchor>
                </Anchors>
                <TexCoords left="0.1" right="0.9" top="0.1" bottom="0.9" />
            </Texture>
                
            <FontString name="$parentCurrency2" text="100" inherits="GameFontNormalSmall" justifyH="RIGHT">
                <Size x="100" y="40"></Size>
                 <Anchors>
                    <Anchor point="BOTTOMRIGHT" x="-215" y="-40"></Anchor>
                </Anchors>
            </FontString>
            <Texture name="$parentCurrency2Texture" file="Interface\MoneyFrame\UI-GoldIcon">
                <Size x="11" y="11"></Size>
                 <Anchors>
                    <Anchor point="BOTTOMRIGHT" x="-203" y="-25"></Anchor>
                </Anchors>
                <TexCoords left="0.1" right="0.9" top="0.1" bottom="0.9" />
            </Texture>  
                
            <FontString name="$parentCurrency3" text="100" inherits="GameFontNormalSmall" justifyH="RIGHT">
                <Size x="100" y="40"></Size>
                 <Anchors>
                    <Anchor point="BOTTOMRIGHT" x="-275" y="-40"></Anchor>
                </Anchors>
            </FontString>
            <Texture name="$parentCurrency3Texture" file="Interface\MoneyFrame\UI-GoldIcon">
                <Size x="11" y="11"></Size>
                 <Anchors>
                    <Anchor point="BOTTOMRIGHT" x="-263" y="-25"></Anchor>
                </Anchors>
                <TexCoords left="0.1" right="0.9" top="0.1" bottom="0.9" />
            </Texture>
            
                
            </Layer>

        </Layers>
        <Frames>
            <ScrollFrame name="GwCurrencyWindow" hidden="true" parentKey="currencyWindow">
                <Size x="512" y="512"></Size>
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                    <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="0" y="0" />
                </Anchors>
                
                <Frames>
                    <Frame parentKey="scrollchild">
                        <Size x="512" y="512"></Size>
                        <Anchors>
                            <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                            <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="0" y="0" />
                        </Anchors>
                        <Scripts>
                            <OnLoad>
                                hooksecurefunc(GwBagFrame,'SetPoint',function() 
                                  GwCurrencyWindow.scrollchild:SetWidth(GwBagFrame:GetWidth()-24)
                                end)
                            </OnLoad>
                        </Scripts>
                    </Frame>
               
                    <Slider name="$parentSlider" parentKey="slider" orientation="VERTICAL" enableMouse="true" virtual="true">
                        <Size x="12" y="12"></Size>
                        <Anchors>
                            <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="-12" y="-32"></Anchor>
                            <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-12" y="32"></Anchor>
                        </Anchors>
                        
   
                        <ThumbTexture name="$parentThumb" parentKey="thumb" file="Interface\AddOns\GW2_UI\textures\scrollbarmiddle">
                            <Size x="12" y="100"/>
                             <Anchors>
                              <Anchor point="TOP" relativePoint="TOP" ></Anchor>
                            </Anchors>
                        </ThumbTexture>
                        <Layers>
                            <Layer>
                                <Texture file="Interface\AddOns\GW2_UI\textures\scrollbg">
                                    <Anchors>
                                        <Anchor point="TOP" relativePoint="TOP"></Anchor>
                                        <Anchor point="BOTTOM" relativePoint="BOTTOM"></Anchor>
                                    </Anchors>
                                </Texture>
                            </Layer>
                        </Layers>
                        <Scripts>
                            <OnValueChanged>
                                self:GetParent():SetVerticalScroll(value)
                            </OnValueChanged>
                            <OnLoad>
                                self:SetValue(1)
                            </OnLoad>
                        </Scripts>
                    </Slider>
                    <Button name="$parentScrollButtonUp">
                     <Size x="12" y="12"></Size>
                        <Anchors>
                            <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="-12" y="-22"></Anchor>
                        </Anchors>
                    <Layers>
                        <Layer>
                            <Texture file="Interface\AddOns\GW2_UI\textures\scrollbutton">
                                <Size x="12" y="12"></Size>
                                    <Anchors>
                                        <Anchor point="TOP" relativePoint="TOP"></Anchor>
                                    </Anchors>
                            </Texture>
                        </Layer>
                    </Layers>
                    </Button>         <Button name="$parentScrollButtonDown">
                     <Size x="12" y="12"></Size>
                        <Anchors>
                       <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-12" y="18"></Anchor>
                        </Anchors>
                    <Layers>
                        <Layer>
                            <Texture file="Interface\AddOns\GW2_UI\textures\scrollbutton">
                                <Size x="12" y="12"></Size>
                                    <Anchors>
                                        <Anchor point="TOP" relativePoint="TOP"></Anchor>
                                    </Anchors>
                                  <TexCoords left="0" right="1" top="1" bottom="0" />
                            </Texture>
                        </Layer>
                    </Layers>
                    </Button>
                </Frames>

            <Scripts>
            <OnMouseWheel>
                delta = -delta * 10
                local s = math.max(0,self:GetVerticalScroll() + delta)
              
                self:SetVerticalScroll(s)
                self.slider:SetValue(s)
            </OnMouseWheel>    
                <OnLoad>
                    GwCurrencyWindow.height = 0
                </OnLoad>
            </Scripts>
            </ScrollFrame>
            <Button name="GwCurrencyIcon">
                <Size x="32" y="32"></Size>
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" x="2" y="-2" />
                </Anchors>
               <NormalTexture file="Interface\AddOns\GW2_UI\textures\currency-icon"></NormalTexture>
                <Scripts>
                    <OnClick>
                        gw_bag_toggleCurrency();
                    </OnClick>
                </Scripts>
            </Button>
        </Frames>
        <Scripts>
            <OnLoad>
                
                GwBagFrameBagSpaceString:SetFont(UNIT_NAME_FONT,12)
                GwBagFrameBagSpaceString:SetTextColor(255/255,255/255,255/255)
                GwBagFrameBagSpaceString:SetShadowColor(0,0,0,0)
                
                gw_update_free_slots()
                
                
                self:RegisterEvent('PLAYER_MONEY')
                GwBagFrameHeaderString:SetFont(DAMAGE_TEXT_FONT,24)
                
                
                GwBagFrameBronze:SetFont(UNIT_NAME_FONT,12)
                GwBagFrameBronze:SetTextColor(177/255,97/255,34/255)
                
                GwBagFrameSilver:SetFont(UNIT_NAME_FONT,12)
                GwBagFrameSilver:SetTextColor(170/255,170/255,170/255)
                
                GwBagFrameGold:SetFont(UNIT_NAME_FONT,12)
                GwBagFrameGold:SetTextColor(221/255,187/255,68/255)
                
                GwBagFrameCurrency1:SetFont(UNIT_NAME_FONT,12)
                GwBagFrameCurrency1:SetTextColor(1,1,1)       
                
                GwBagFrameCurrency2:SetFont(UNIT_NAME_FONT,12)
                GwBagFrameCurrency2:SetTextColor(1,1,1)        
                
                GwBagFrameCurrency3:SetFont(UNIT_NAME_FONT,12)
                GwBagFrameCurrency3:SetTextColor(1,1,1)
                
                gw_update_player_money()
            </OnLoad>
            <OnEvent>
                gw_update_player_money()
            </OnEvent>
            <OnSizeChanged function="gw_OnBagFrameChangeSize">
            
            </OnSizeChanged>
        </Scripts>

        <Frames>
             <Frame name="GwBagFrameResize" frameStrata="HIGH" frameLevel="5" enableMouse="true" movable="true" parent="UIParent" virtual="true">
                <Size x="40" y="40"></Size>
                <Anchors>
                    <Anchor point="BOTTOMRIGHT" relativeTo="GwBagFrame" relativePoint="BOTTOMRIGHT" x="0" y="0"></Anchor>
                </Anchors>
                      <Layers>
                    <Layer level="OVERLAY">
                        <Texture name="$parentTexture" file="Interface\AddOns\GW2_UI\textures\resize">
                           
                            <Size x="32" y="32"></Size>
                            <Anchors>
                                <Anchor point="CENTER" x="0" y="0"></Anchor>
                            </Anchors>
                        </Texture>
                   
                    </Layer>
                </Layers>
                <Scripts>
                    <OnLoad>
                        self:RegisterForDrag("LeftButton");
                    </OnLoad>

                      <OnDragStart>
                          self:StartMoving();
                          _,_,_,GW_BAG_RS_START_X,GW_BAG_RS_START_Y = self:GetPoint()
                          GwBagFrame:SetPoint('BOTTOMRIGHT',self,'BOTTOMRIGHT',0,0);
                          GwBagFrame:SetScript('OnUpdate',gw_onBagDragUpdate)
                        </OnDragStart>
                      <OnDragStop>
                        gw_bagOnResizeStop(self)                         
                    </OnDragStop>
                </Scripts>

            </Frame>
            <Button name="GwBagButtonSettings" text="" >
                <Anchors>
                    <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="-8" y="-8" />
                </Anchors>
                <Size x="24" y="24" />
                <Anchors><Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="-10" y="30"/></Anchors>
                <NormalTexture file="Interface\AddOns\GW2_UI\textures\MainMenuMicroButton-Up"></NormalTexture>
                <PushedTexture  file="Interface\AddOns\GW2_UI\textures\MainMenuMicroButton-Down"></PushedTexture >
                <HighlightTexture  file="Interface\AddOns\GW2_UI\textures\MainMenuMicroButton-Down"></HighlightTexture >

                <NormalFont style="ChatBubbleFont"></NormalFont>
                <HighlightFont style="ChatBubbleFont"></HighlightFont>
                <Scripts>
                    <OnClick>
                       if GwBagFrameDropDown:IsShown() then
                            GwBagFrameDropDown:Hide()
                        else
                            GwBagFrameDropDown:Show()
                        end
                    </OnClick>
                </Scripts>
            </Button>
            
            <Frame name="$parentDropDown" frameStrata="HIGH" hidden="true" frameLevel="8">
                <Size x="120" y="60" ></Size>
                <Anchors>
                    <Anchor point="BOTTOMRIGHT" relativeTO="GwBagButtonSettings" relativePoint="LEFT" y="-5"></Anchor>
                </Anchors>
                <Layers>
                    <Layer level="OVERLAY" textureSubLevel="8">
                        <Texture file="nterface\AddOns\GW2_UI\textures\gwstatusbar" >
                            <Color r="0" b="0" g="0"></Color>
                            <Anchors>
                                <Anchor point="TOP" relativePoint="TOP"></Anchor>
                                <Anchor point="BOTTOM" relativePoint="BOTTOM"></Anchor>
                                <Anchor point="LEFT" relativePoint="LEFT"></Anchor>
                                <Anchor point="RIGHT" relativePoint="RIGHT"></Anchor>
                            </Anchors>
                        </Texture>
                    </Layer>
                </Layers>
                <Frames>
                    <Button name = "GwBagFrameDropDownSortBags" text="Sort bags">
                        <Size x="100" y="30"></Size>
                        <Anchors>
                            <Anchor point="TOP" relativePoint="TOP"></Anchor>
                        </Anchors>
                        <NormalFont style="ChatBubbleFont"></NormalFont>
                        <HighlightFont style="ChatBubbleFont"></HighlightFont>
                        <Scripts>
                            <OnClick>
                                PlaySound(SOUNDKIT.UI_BAG_SORTING_01);
                                SortBags();
                                self:GetParent():Hide()
                            </OnClick>
							<OnLoad>
								self:SetText(GwLocalization['SORT_BAGS'])
							</OnLoad>
                        </Scripts>
                    </Button>
                    <Button text="Compact view">
                        <Size x="100" y="30"></Size>
                        <Anchors>
                            <Anchor point="TOP" relativePoint="TOP" y="-30"></Anchor>
                        </Anchors>
                        <NormalFont style="ChatBubbleFont"></NormalFont>
                        <HighlightFont style="ChatBubbleFont"></HighlightFont>
                        <Scripts>
                            <OnClick>
                                self:SetText(gw_backFrameCompactToggle())
                                self:GetParent():Hide()
                            </OnClick>
                            <OnLoad>
                                if gwGetSetting('BAG_ITEM_SIZE')==45 then
                                    self:SetText(GwLocalization['COMPACT_ICONS'])
                                else
                                    self:SetText(GwLocalization['EXPAND_ICONS'])
                                end
                            </OnLoad>
                        </Scripts>
                    </Button>
                </Frames>
            </Frame>
            
            
            <Button name="GwBagButtonClose" text="" >
                <Size x="20" y="20" />
                <Anchors><Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="-10" y="30"/></Anchors>
                <NormalTexture file="Interface\AddOns\GW2_UI\textures\window-close-button-normal"></NormalTexture>
                <PushedTexture  file="Interface\AddOns\GW2_UI\textures\window-close-button-hover"></PushedTexture >
                <HighlightTexture  file="Interface\AddOns\GW2_UI\textures\window-close-button-hover"></HighlightTexture >

                <NormalFont style="ChatBubbleFont"></NormalFont>
                <HighlightFont style="ChatBubbleFont"></HighlightFont>
                <Scripts>
                    <OnClick>
                        CloseAllBags()
                        if GwCurrencyWindow:IsShown() then
                            GwBagFrame:Hide()
                        end
                    </OnClick>
                </Scripts>
            </Button>
            <Frame name="GwBagContainer0">
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                </Anchors>
            </Frame>            
            <Frame name="GwBagContainer1">
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                </Anchors>
            </Frame>            
            <Frame name="GwBagContainer2">
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                </Anchors>
            </Frame>            
            <Frame name="GwBagContainer3">
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                </Anchors>
            </Frame>            
            <Frame name="GwBagContainer4">
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                </Anchors>
            </Frame>
        </Frames>
    </Frame>
    
    <Frame name="GwBagItemBackdrop" frameStrata="HIGH" frameLevel="5" enableMouse="false" virtual="true">
        <Size x="40" y="40"></Size>
        <Layers>
            <Layer textureSubLevel="-1" level="BACKGROUND">
               <Texture name="$parentBackground"   file="Interface\AddOns\GW2_UI\textures\bag\bagitembackdrop">
                    <Anchors>
                        <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" x="0" y="0" />
                        <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="0" y="0" />
                        <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0" />
                        <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="0" y="0" />
                    </Anchors>
                </Texture>
            </Layer>
        </Layers>
    </Frame>
    <Frame name="GwItemUpgrade"  enableMouse="false" virtual="true">
        <Size x="40" y="40"></Size>
        <Anchors>
            <Anchors point="CENTER"></Anchors>
        </Anchors>
    
        <Layers>
            <Layer>
                   <Texture file="Interface\AddOns\GW2_UI\textures\updateicon-UP">
                       <Color r="0" g="1" b="0"></Color>
                    <Size x="16" y="16"></Size>
                     <Anchors>
                         <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" x="0" y="0" />
                       </Anchors>
                </Texture>
            </Layer>
        </Layers>
    </Frame>
    <Frame name="GwcurrencyCat" virtual="true">
        <Size x="512" y="32"></Size>
        <Anchors>
            <Anchors point="TOPLEFT"></Anchors>
        </Anchors>
        <Layers>
            <Layer>
                <Texture name="$parentBackground"   file="Interface\AddOns\GW2_UI\textures\bag-sep">
                     <Size x="512" y="32"></Size>
                     <Anchors>
                         <Anchors point="TOPLEFT"></Anchors>
                    </Anchors>
                </Texture>
            </Layer>
            <Layer textureSubLevel="2">
                <FontString name="$parentBagSpaceString" parentKey="string" text="Name Could not be loaded" inherits="GameFontNormalSmall" justifyV="CENTER" justifyH="LEFT">
                <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="10" y="-5" />
                </Anchors>
                <Size x="200" y="24" />
            </FontString>
            </Layer>
        </Layers>
        <Scripts>
            <OnLoad>
                self.string:SetFont(DAMAGE_TEXT_FONT,14)
                self.string:SetTextColor(1,1,1)
            </OnLoad>
        </Scripts>
    </Frame>  
    <Button name="GwcurrencyItem" virtual="true">
        <Size x="512" y="32"></Size>
        <Anchors>
            <Anchors point="TOPLEFT"></Anchors>
        </Anchors>
        <Layers>
            <Layer level="ARTWORK">
                 <Texture parentKey="zebra" file="Interface\AddOns\GW2_UI\textures\gwstatusbar">
                     <Size x="32" y="32"></Size>
                     <Anchors>
                         <Anchors point="TOPLEFT" relativePoint="TOPLEFT"></Anchors>
                         <Anchors point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT"></Anchors>
                    </Anchors>
                </Texture>
            </Layer>
            <Layer>
                <Texture parentKey="icon">
                     <Size x="32" y="32"></Size>
                     <Anchors>
                         <Anchors point="TOPLEFT" relativePoint="TOPLEFT"></Anchors>
                         <Anchors point="BOTTOMRIGHT" relativePoint="TOPLEFT" x="32" y="-32"></Anchors>
                    </Anchors>
                    <TexCoords left="0.1" right="0.9" top="0.1" bottom="0.9" />
                </Texture>
            </Layer>
            <Layer textureSubLevel="2">
                <FontString name="$parentBagSpaceString" parentKey="string" text="Name Could not be loaded" inherits="GameFontNormalSmall" justifyV="CENTER" justifyH="LEFT">
                    <Anchors>
                        <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="42" y="-5" />
                    </Anchors>
                    <Size x="200" y="24" />
                </FontString> 
                <FontString name="$parentBagSpaceString" parentKey="amount" text="Amount Could not be loaded" inherits="GameFontNormalSmall" justifyV="CENTER" justifyH="RIGHT">
                    <Anchors>
                        <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="-5" y="-5" />
                    </Anchors>
                    <Size x="200" y="24" />
                </FontString>
            </Layer>
        </Layers>
        <Scripts>
            <OnLoad>
                self.string:SetFont(UNIT_NAME_FONT,12)
                self.string:SetTextColor(1,1,1)    
                
                self.amount:SetFont(UNIT_NAME_FONT,12)
                self.amount:SetTextColor(1,1,1)
            </OnLoad>
        </Scripts>
    </Button>
    
</Ui>
