How to reload a banner ad from a view's ViewModel? - xamarin

I have implemented a pull-to-refresh to my xamarin app. I am using MVVM, and I want to know if and how could I reload/refresh the banner ad that I have in my view, from the Refresh command that my pull-to-refresh raises. Which obviously is in the ViewModel. I searched everywhere but there is not any documentation on this. Also I think that I could manually navigate back and then navigate to that page again, but I don't think that's the most efficient solution.
Thank you in advance!
EDIT1 - I am using the Prism framework in case that helps, I didn't find a way to even reload the entire view, with prism.

Related

Which toolbox does facebook app use

which toolbox is that?
I use ListView now, but if I click it, it looks like I choose it, not click it.
so I want to change.
Your question is very unclear but I'll share some information about ListView.
I don't know which facebook app is that but official Facebook App (not beta) is using ListView too AFAIK.You can customize ListView's Style and ItemTemplate to achieve that.
Theese 2 MSDN articles about ListView will help you.
https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.listview.aspx
https://msdn.microsoft.com/en-us/library/windows/apps/xaml/jj709922.aspx

Custom Navigation with Xamarin.Forms

I’m working on an application for Android and iOS, which requires a certain flexibility for one or two views. That’s why we created & implemented a service that translated a basic list of objects into a user interface for both iOS & Android. But now that Xamarin.Forms is released, we decided to replace our service by the one Xamarin provides. I did succeed in creating the views with Xamarin.Forms, resulting in better looking & smoother running pages. But my problem lies in the navigation of it. Here is a little drawing on what I would like to achieve:
I would like my app to start an activity that starts with a custom fragment. After clicking a button on this fragment, I would like the page I created with the Xamarin.Forms api to be added to my current navigation stack! Once the user is finished with the Xamarin.Forms page, it navigates to a second custom fragment, all that without breaking the navigation cycle. Does anybody have an idea on how I can achieve this?
For the iOS developpers: replace Activity with NavigationController & Fragment with ViewController
Take a look at CarouselPage for Xamarin.Forms' own approach. It doesn't look like that's what you need but you can also look at its source code and maybe make a custom renderer yourself.
You may also want to take a look at MVVM
As for the easier/hackier way you'd want to make a button on each page and when the button is tapped execute Navigation.PushModalAsync(nextPage) - there won't be a "< Back" button any more, you may need to implement that yourself if you need it.
If by your meaning of 'current navigation stack' is for using the native Navigation of each platform, then remember that you don't have to use Xamarin.Forms' Navigation Model and functions such like PushAsync.
If you prefer to do Navigation with code specific to each platform then you can do this the same as normal. Just create your stub pages in each platform specific project and set the Xamarin.Forms content for each page from the shared project.
From each platform specific stub page (Activity / UIView / PhoneApplicationPage) you could then execute an Action<> call setting on the shared Xamarin.Forms page to help with the navigation, or alternatively, hook into a custom-event that is raised from the Xamarin.Forms** page back to the platform specific stub page to allow you to do navigation from there.
Like Sten mentioned there won't be any 'Back' button so you will most likely have to do that yourself.

Opening url (blog) with scroll view

I've tried so many links and they all revert back to a web view.
I only just got Xcode and I'm pretty new to all this stuff, its complete different to C and Java.
Anyways, I have added a scroll view to my frame and gave it a class I've made myself (hopefully that works).
Now, when I load the application, I want it to be able to load a webpage (my blog) into the scroll view
any idea how?
Regards,
Ryan
You need to use a UIWebView for loading web pages. The scroll for UIWebView would automatically adjust according to the size of the webpage.

iOS 7 Back Button in Interface builder

I've been messing around with the new iOS7 SDK and I want to make a back button like there is in most of the other OS apps. Heres a screen shot of what I'm trying to do:
But I can't figure out how. I've never really messed with interface builder because I usually code with opengl apps, so any solutions would be much appreciated. Thanks.
That is is standard "back" button. You get this when you use a navigation controller and show one view controller then push a second. The "<" means "go back". The "September" part is the title of the previous view controller. You don't need to create one of these. Just make proper use of a navigation controller and a couple of view controllers and it will appear automatically.

Doubts regarding handling the state of pages in Wp7 Phone App

I have the application ,in which i save the state of the page and while deactivate the application,and once i get in foreground the application,i will restore the data.But when i click the back button at the time,i don't have the Object instance for the previous page .So how can i handle at that time?
On BackKey Press,I need to some thing like
1)Check the pages in the stack,remove the previous page and create the new instance of the page or any other think?
Your data should be saved when your application is deactivated and reloaded when your application is restored. It sounds like you are not restoring your data correctly.
This is where using something like MVVM model where your data is separate from your UI code is really helpful. Check out the MVVM light toolkit on CodePlex.
http://mvvmlight.codeplex.com/
It is too general a question to give more specific answers than that. Sorry.
Try coding up something and posting specific questions regarding your code.

Resources