Forum Cross Platform with Xamarin

Opening document depending on month of the year

BorisopritBorisoprit Member ✭✭✭
edited November 2019 in Cross Platform with Xamarin


I asked a question here over opening a document based on the month of the year.

pritaeas gave me an option but there is a problem and he also dont know why it is not working

above the webview i have a label that is showing the month of the date on the phone.

That works also when i change the date.

changing the date to the 12 month it is working , and the 11 month also.

But month 1 till 10 not ??? the label is showing the month 1 till 10 but the document is not opening.

Changed the document but no problem there.

This is what pritaeas gave me to work with but i am stuck


    <Label x:Name="Maand"
           Text="{Binding Source={x:Static sys:DateTime.Now}, StringFormat='{0:MM}'}" />

    <!-- Place new controls here -->
    <ProgressBar Progress="0.2"  
    <WebView x:Name="Webview"  




` public MainPage()

        Webview.Source= monthlySources[DateTime.Now.Month];

    private readonly Dictionary<int, string> monthlySources = new Dictionary<int, string>()

{ 01, "" },
{ 02, "" },
{ 03, "" },
{ 04, "" },
{ 05, "" },
{ 06, "" },
{ 07, "" },
{ 08, "" },
{ 09, "" },
{ 10, "" },
{ 11, "" },
{ 12, "" },

    protected async override void 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;




  • JarvanJarvan Member, Xamarin Team Xamurai

    I've reproduced the code and it works fine on my side. All the documents corresponding with the months can be displayed as shown. What's the version of Xamarin.Forms?

    Here is the demo file you can refer to.

  • BorisopritBorisoprit Member ✭✭✭

    Hello Jarvan ,

    Thanks for the reply and sample.

    This is the version

    Now the strange part , the sample works but .

    Hope you like a challange , when i change the date on my android phone to let say september .

    It is not downloading anything anymore , not with mine or your example ?

    Am looking for something that looks wich month it is of the year and then download that document and show in webview.

    On the example on the other forum that pritaeas gave works with him but not on my phone.

    Yes works but when change the date to other month not any more ?????

    I cannot change the date on my computer because it is a company pc and the IT don't alllow that.

    So the simulator has no point thats why i put it on the android phone (

    Debug or Release makes no difference.

  • JarvanJarvan Member, Xamarin Team Xamurai

    I've tested on a physical device and changed the links because of the access reason. After changing the device month, the demo works fine.

    when i change the date on my android phone to let say september .

    Did this problem only occur with Septemeber?

Sign In or Register to comment.