mvvmcross

MvvmCross vnext : monodroid use a VideoView inside a plugin

让人想犯罪 __ 提交于 2019-12-13 02:35:51
问题 I was playing with Xamarin Mobile api MediaPicker which uses MediaRecorder with monodroid to make a plugin to record a video. Android must preview the video inside a VideoView. This restriction applies to wp7 and ios too for privacy. So, I need to get the VideoView (or Rectangle in wp7) from my custom view and setPreviewDisplay to this VideoView in my plugin (or init MediaPicker with this VideoView). What is the best way to implement my portable plugin which requires UI element ? Thanks in

Implementing cell reuse for varying height cells in UITableView (iOS8+)

删除回忆录丶 提交于 2019-12-13 02:07:36
问题 I have a custom cell layout, inheriting from MvxTableViewCell. One of the cell's contained views is a UILabel that supports text wrapping. The wrapping will mean the cells can be of different heights as that is driven by how much text is in each data item. The custom table cell is defined without any Storyboard or NIB. It is laid out in code and uses AutoLayout. I am finding that the cells are being reused and the heights are staying the same as they were when they were previously used. When

Error passing parameters to mvvmcross viewmodels

霸气de小男生 提交于 2019-12-13 01:12:46
问题 I found this example in the Bestseller exmaple public ICommand ViewDetailCommand { get { return new MvxRelayCommand(() => RequestNavigate<BookViewModel>(new { category= CategoryEncoded, book=ISBN })); } } public BookViewModel(string category = null, string book = null) { category = category ?? string.Empty; book = book ?? string.Empty; AsyncFindBook(category, book); } So I have tried doing public IMvxCommand GetGpsCommand { get { return new MvxRelayCommand<SetupViewModel>(type =>

Open ViewModel from Appdelegate

徘徊边缘 提交于 2019-12-13 00:24:05
问题 I am trying to open a specific view in my Xamarin.Ios-Project via a Web-Url. The url-scheme works fine and i also check the url in the AppDelegate class as shown below: [Register("AppDelegate")] public partial class AppDelegate : MvxApplicationDelegate { // other methods ... public override bool OpenUrl(UIApplication application, NSUrl url, string sourceApplication, NSObject annotation) { if (url == null) return false; var uri = new Uri(url.ToString()); if(uri.Host.Equals("myscheme-host")) {

Take/Select picture and show it in ImageView without saving first (using MvvmCross)

China☆狼群 提交于 2019-12-12 22:01:12
问题 I want to choose a picture from library or take a picture with the camera and show the result to the view (ImageView) But according to a few posts including this one, the MvxHttpImageView I use needs a Uri to show the image (wheter it comes from file systemor camera). This implies, converting the Stream into a file and getting the Uri back. I wrote a Picture Service that does the job: public class PictureService : IPictureService, IMvxServiceConsumer<IMvxPictureChooserTask>,

MvxSpinner not binding

老子叫甜甜 提交于 2019-12-12 21:30:04
问题 So I needed to change the text color of my MvxSpinner. I see you can't change the color from the xaml code so I had to do use templates for the spinner. But before I used templates for the spinner everything would bind correctly with the viewModel, now it seems it can't find my properties in the viewmodel when I use templates. Is there a way to expose the current viewmodel to the templates? Below is my code segments if it helps <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns

How to bind NSAttributeString (or NSMutableAttributedString)

亡梦爱人 提交于 2019-12-12 21:27:38
问题 I want to bind an attributed string to a UILabel using MVVMCross. To bind a regular string I would just do: set.Bind(MyLabel).To(vm => vm.MyString); But I need a string where part of the text will use one color and one font size and another part will use a different color and a different font size. If this was static, no problem, I'd add a label in interface builder and set it "attributed" and then set whatever font options I want on which ever parts of the string I need. So I thought with

Making mono cross platform support for Task/Intent

我的未来我决定 提交于 2019-12-12 18:27:35
问题 I have a application for WP7 and Android, and this application must have supporthas support for "any" connection type (WiFi, NFC, Bluetooth etc) I have then created a layered model with MVVMCross https://github.com/slodge/MvvmCross I have an interface for example Android Bluetooth must implement interface IConnectionService { List<TargetDevice> FindDevices(); void Connect(TargetDevice targetDevice); void Disconnect(); byte[] Read(); void Write(byte[] command); } I want to be able to request

How to use Community SQLite plugin in MVVMCross

*爱你&永不变心* 提交于 2019-12-12 16:07:30
问题 In my application I was using the old SQLite-plugin. Since MVVMCross 3.0.14 this version is deprecated and the Community.Sqlite plugin is advised. The Community plugin was added via Nuget. When trying to use the plugin without a bootstrapper, at runtime I get the error: Failed to resolve parameter for parameter connectionFactory of type ISQLiteConnectionFactory when creating... When trying to use the plugin with a bootstrapper, also at runtime, I get the error: plugin not registered for type

MvvmCross iOS UITableView doesn't update on Property Changed

二次信任 提交于 2019-12-12 13:58:08
问题 My table view does not update whenever its source property is changed. The code is as follows: ViewController: public override void ViewDidLoad() { base.ViewDidLoad(); View.BackgroundColor = UIColor.White; var table = new UITableView(new RectangleF(0, 80, Device.Width, Device.Height - 80)); Add(table); var source = new MvxStandardTableViewSource(table, "TitleText SessionInfo"); table.Source = source; var set = this.CreateBindingSet<JoinSessionViewController, JoinSessionViewModel>(); set.Bind