Hi guys!
I have been scratching my head caused by a couple of challenges. Could someone please provide me a clue or two to these challenges?
1 - I am trying to make a panel appear/disappear when toggling a button. The problem is that I can not find the right way to make the panel disappear correctly. It is suppose to disappear the same way that the panel appeared.
I have tried to Change Height to the detailsFolder when toggling. However, the resize seem to happen “from the middle of the Panel”, resulting in an other issue where the Panel shrinks from both top and bottom.
2 - I would like to make sure that the detailsFolder never eats up more than 3/5 of the (bottom part of the) screen, no matter the count of the nanoItem.
I have tried to dock an empty Panel to the Top of the screen. However, detailsFolder does not seem to care about what space any top docked requires, and starts to overlay the top docked Panel instead.
Here you have a clip illustrating the issue:
<App>
<Panel Background="#e7e9eaFF" Width="100%" Height="100%">
<DockPanel>
<!-- Navigator todo -->
<Panel ux:Name="bottomPanel" Width="100%" Height="40" Color="Black" Dock="Bottom">
<Text Value="BottomPanel" FontSize="16" Alignment="Center" Color="#FFF"/>
</Panel>
<!-- Content container -->
<Rectangle ux:Name="detailsFolder" Dock="Bottom" Color="#FFF" CornerRadius="2,2,0,0" Margin="10,0,10,0">
<StackPanel ux:Name="detailsContainer" Visibility="Collapsed" Margin="15">
<Each "nanoItem" Count="6">
<Grid ux:Name="NanoGrid" Columns="1*,80" Margin="0,10,0,10">
<StackPanel Alignment="CenterLeft">
<Text Color="#000" FontSize="16" TextWrapping="Wrap" Value="Info line" />
</StackPanel>
<Panel Alignment="Right">
<Text Alignment="Center" Value="Value" FontSize="12" Color="#000" Margin="2,1,0,0" />
</Panel>
</Grid>
</Each>
</StackPanel>
<LayoutAnimation>
<Move Vector="1" RelativeTo="PositionChange" Duration="0.5" DurationBack="0.5" />
</LayoutAnimation>
</Rectangle>
<!-- Expandor button -->
<Rectangle ux:Name="expandFolderButton" Dock="Bottom" Height="72" Width="72" CornerRadius="50,50,0,0" Color="#F44336FF" HitTestMode="LocalBounds">
<Text Alignment="Center" FontSize="34" Value="+" Color="#FFF" />
<Tapped>
<Toggle Target="folderOpen" />
</Tapped>
<DropShadow />
<LayoutAnimation>
<Move Vector="1" RelativeTo="PositionChange" Duration="0.5" DurationBack="0.5" />
</LayoutAnimation>
</Rectangle>
<WhileTrue ux:Name="folderOpen">
<Change detailsContainer.Visibility="Visible"/>
</WhileTrue>
</DockPanel>
</Panel>
</App>