TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
B Oprit
1.3k
429
4.1k
Show document depending on month of the year
Nov 18 2019 7:55 AM
Hello ,
I am new at Xamarin Forms and this is what i am trying to do.
Based on the month i want to show a document from Google docs in a Webview
I know how to show the document but not the if statement.
Trying to put a label with the month showing in a stacklayout with the webview , so far so good.
The label is showing 11
But how do i make it work that when the month is changing it is going to another document.
This month is
Webview.Source = "https://docs.google.com/spreadsheets/d/1h2wQMlPpvnajq_Dg-Yx6Gwh4wzy7ZPd3Kp5gnDnEszY/edit?usp=sharing";
and this for December
https://docs.google.com/spreadsheets/d/1BEryoKhaTP6tx2VsYibYXE5kJoEBKqGFNrhov1W_b7s/edit?usp=sharing
The mainpage
Text="{Binding Source={x:Static sys:DateTime.Now}, StringFormat='{0:MM}'}" />
HorizontalOptions="FillAndExpand"
x:Name="progress"
ProgressColor="Maroon"
IsVisible="True"/>
HeightRequest="1000"
WidthRequest="1000"
Navigating="OnNavigating"
Navigated="OnNavigated"
VerticalOptions="FillAndExpand"/>
And the Main.xaml.cs
public
partial
class
MainPage : ContentPage
{
public
MainPage()
{
InitializeComponent();
Webview.Source =
"https://docs.google.com/spreadsheets/d/1h2wQMlPpvnajq_Dg-Yx6Gwh4wzy7ZPd3Kp5gnDnEszY/edit?usp=sharing"
;
}
protected
async
override
void
OnAppearing()
{
base
.OnAppearing();
await progress.ProgressTo(0.9, 900, Easing.SpringIn);
}
protected
void
OnNavigating(
object
sender, WebNavigatingEventArgs e)
{
// SfBusyIndicator busyIndicator = new SfBusyIndicator();
progress.IsVisible =
true
;
// busyindicator.IsVisible = true;
}
protected
void
OnNavigated(
object
sender, WebNavigatedEventArgs e)
{
// SfBusyIndicator busyIndicator = new SfBusyIndicator();
progress.IsVisible =
false
;
// busyindicator.IsVisible = false;
}
}
}
Reply
Answers (
5
)
ANR in Xamarin Android C#
not getting correct address in android studio