I\'m trying to make a change to sample project Cirrious.Conference. In particular in the Touch View at SessionView class and at this class
https://github.com/slodge/
Since UIWebView
doesn't expose a property for the LoadRequest
, then you can't bind directly to it.
If you want to use binding for LoadRequest
, then 3 options available to you are:
Inherit MyWebView
from UIWebView
, add a C# property that drives LoadRequest
and then use that class in your UI and that property in your Swiss binding - e.g.:
[Register("MyWebView")]
public class MyWebView : UIWebView
{
public MyWebView()
{
}
public MyWebView(IntPtr handle) : base(handle)
{
}
private string _myUrl;
public string MyUrl
{
get { return _myUrl; }
set
{
if (_myUrl == value) return;
_myUrl = value;
LoadRequest(value); // or similar (I've not checked the syntax!)
}
}
}
Implement a custom target Swiss binding and add it to your Setup.cs. The process for this is described in this Custom Bindings presentation - which also includes links to some examples (one of them is in the Conference app)
If this property will never change, then don't use binding and instead just call LoadRequest in your MvxViewController
ViewDidLoad - e.g.
public void ViewDidLoad()
{
base.ViewDidLoad();
var myViewModel = (MyViewModel)ViewModel;
var url = myViewModel.Url;
TheWebView.LoadRequest(url);
}