Replies: 4 comments
-
Ah ok so this way the NavigationBar always stays static at the top of the page and we simply have content below/behind it that will simulate its extended state. Yeah this way we can simply have the native renderers react to the DependencyProperty for the Expanded state and set its background to transparent and remove the title Do we maybe want to expose something like an ExpandedTemplate that accepts a DataTemplate so you can define whatever you want as the layout of the expanded view, including background images, etc.? |
Beta Was this translation helpful? Give feedback.
-
Great idea for the |
Beta Was this translation helpful? Give feedback.
-
An alternative version less fake, but with maybe issue with smoothness (to be tested): Alternative for an expandable ToolbarInstead of mocking it, we leave to the toolbar itself the responsibility to implement its behavior.
I propose the following properties:
And we'd used it like this: <Grid>
<utu:Toolbar Title="Home">
<utu:ExpandableLayout.ExpandableView>
<utu:ExpandedView MasterScrollViewer="{x:Bind RelatedScrollView}"
ExpandedHeight="160"
State="Expanded"
ExpandedTitleFontSize="26"
ExpandedImage="MontrealSnowTornado.png" />
</utu:ExpandableLayout.ExpandableView>
</utu:Toolbar>
<ScrollViewer x:Name="RelatedScrollView">
<StackPanel Padding="0,180,0,0">
...
</StackPanel>
</ScrollView>
</Grid> The expandable is subscribing to the The toolbar must implement a interface IExpandable
{
/// <summary>
/// Called when the master scroll viewer is scrolling, inducing a modification of the expanded ratio.
/// </summary>
/// <param name="expandedRatio">The expanded ratio: 1 is fully expanded, 0 fully collapsed.</param>
void OnExpansion(double expandedRatio);
} Use case: from expanded to collapsedWe are in expanded state: the
Concerns:The mechanism resizes the toolbar height as we are scrolling: will the resizing be smooth on all platforms? |
Beta Was this translation helpful? Give feedback.
-
@kazo0 @agneszitte @Xiaoy312 I need your opinion on this :) |
Beta Was this translation helpful? Give feedback.
-
A shot at a platform-agnostic implementation of the famous collapsible toolbar layout UX.
Could implement successfully #325.
A
CollapsibleToolbarLayout
has 2 main propertiesICollapsibleToolbar
object
ScrollViewer
For now, we have the
NavigationBar
in the toolkit, so we could just made it implementICollapsibleToolbar
.Now we would like also to support collapsibles background images:
I propose the following properties:
double
CollapsibleToolbarLayoutState
Thickness
double
sting
The pseudo-xaml implementation would look like this:
Basically the 'ExpandedToolbarContent' would contain the expanded UI, the title with expanded title font size and the background image.
And we used it like this:
Use case: from expanded to collapsed
We are in expanded state: the
ExpandedToolbarContent
is displaying a montreal image in the background and a title with a font size of 26, height is 160dp.In this state the
Toolbar
background is transparent, and the title is hidden, itsCollapsibleState
= "Expanded".Our
CollapsibleToolbarLayout
state = "Expanded".CollapsibleToolbarLayout
and ourToolbar
states = "InBetween".ExpandedToolbarContent
respectively to the Y scroll axis we are slowly fading background from image to our toolbar background. And scaling title font size toToolbar
font size.ExpandedToolbarContent
reaches the bottom of theToolbar
, we set ourCollapsibleToolbarLayout
state to "Collapsed". We also setToolbar
states = "Collapsed". It does make visible theToolbar
background and title.This way we can mimic with little effort a collapsible bar.
Beta Was this translation helpful? Give feedback.
All reactions