Advertisement
Guest User

Untitled

a guest
Oct 13th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. <AbsoluteLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" >
  2.  
  3. <StackLayout VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" AbsoluteLayout.LayoutFlags="All"
  4. AbsoluteLayout.LayoutBounds="0,0,1,1">
  5. <ScrollView VerticalOptions="FillAndExpand">
  6. <StackLayout VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" x:Name="webViewLayout">
  7. <WebView x:Name="webcontentcontrol" Source="{Binding WebViewSource}" VerticalOptions="FillAndExpand" HorizontalOptions="Fill"></WebView>
  8. </StackLayout>
  9. </ScrollView>
  10. </StackLayout>
  11.  
  12. <StackLayout IsVisible="{Binding IsBusy}"
  13. AbsoluteLayout.LayoutFlags="PositionProportional"
  14. AbsoluteLayout.LayoutBounds="0.5,0.5,-1,-1">
  15.  
  16. <ActivityIndicator IsRunning="{Binding IsBusy}" Style="{StaticResource ActivityIndicatorStyle}"/>
  17.  
  18. <Label Text="Loading..." IsVisible="{Binding IsBusy}" HorizontalOptions="Center" Style="{StaticResource ActivityIndicatorLabelStyle}"/>
  19.  
  20. </StackLayout>
  21. </AbsoluteLayout>
  22.  
  23. public AnnouncementPage()
  24. {
  25. InitializeComponent();
  26. BindWebViewControl();
  27. }
  28.  
  29. protected override void OnAppearing()
  30. {
  31. webViewLayout.IsVisible = false;
  32. IsBusy= true;
  33. }
  34. private async void BindWebViewControl()
  35. {
  36. var result = await _dataService.GetAnnouncement();
  37. webcontentcontrol.Source = result.Data.First().WebViewSource;
  38. IsBusy = false;
  39. webViewLayout.IsVisible = true;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement