Im trying to open a App-Bar when the user reaches the end of the (ScrollViewer)Page... Therefore I need a indicator when the end is reached...
- My Scrollviewer (maybe because WP8) has no "ViewChanged"-event like posted in other questions
- And this solution is just overkill for my Problem I think: http://blogs.msdn.com/b/slmperf/archive/2011/06/30/windows-phone-mango-change-listbox-how-to-detect-compression-end-of-scroll-states.aspx
I cant find any event within this Viewer which could help me...
<ScrollViewer x:Name="SV_ScrollViewer"
Grid.Row="1"
Margin="12,0,12,0"
ManipulationMode="Control"
AllowDrop="False">
<Grid x:Name="ContentPanel">
<StackPanel>
<Controls:Map
Height="730"
x:Name="M_MainMap"
ZoomLevel="10"
Loaded="Map_Loaded"/>
<phone:LongListSelector
x:Name="LLS_FuelStations"
Height="700">
</phone:LongListSelector>
</StackPanel>
</Grid>
</ScrollViewer>
Thank you for your help!
2-EDIT: The LayoutUpdated-Event was not good for closing app-bar again... I ended up with a Dispatcher-Timer for closing AND opening it. Now it works fine (smooth):
// Constructor
public MainPage()
{
InitializeComponent();
Dispatcher.BeginInvoke(() =>
{
//initialize timer
if (timer == null)
{
int timerSpan = 500;
timer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(timerSpan) };
timer.Tick += (o, arg) => OffsetWatcher();
}
});
}
Closing and opening app-bar:
private void OffsetWatcher()
{
if (SV_ScrollViewer.ScrollableHeight - SV_ScrollViewer.VerticalOffset > 100 )
{
if (ApplicationBar.IsVisible)
{
ApplicationBar.IsVisible = false;
ApplicationBar.IsMenuEnabled = false;
}
}
else
{
if (!ApplicationBar.IsVisible)
{
BuildLocalizedApplicationBar();
}
}
}