예제 #1
0
        public PhotoBrowserViewModel(IImagePickerService imagePickerService)
        {
            _imagePickerService = imagePickerService;

            GalleryCommand = new AsyncCommand(OnGallery);
            CameraCommand  = new AsyncCommand(OnCamera);
        }
예제 #2
0
        public MainPage()
        {
            _imagePickerService = DependencyService.Get <IImagePickerService>();

            if (_imagePickerService == null)
            {
                throw new InvalidOperationException(
                          "Could not resolve IImagePickerService dependecy! " +
                          "On iOS there is scenarios that DependencyAttribute registration didn't work. " +
                          "To fix you may do a manual registration " +
                          "by calling Xamarin.Forms.DependencyService.Register<Xamarin.Forms.ImagePicker.iOS.ImagePickerService>(); " +
                          "on AppDelegate between Forms.Init(); and LoadApplication(...) calls.");
            }

            InitializeComponent();
        }
        public ChatMessageInputViewModel(
            string chatId,
            ChatManager chatManager,
            IImagePickerService imagePicker,
            IChatLocalizedStrings localizedStrings)
        {
            _imagePicker      = imagePicker;
            _chatId           = chatId;
            _chatManager      = chatManager;
            _localizedStrings = localizedStrings;

            OpenCameraCommand    = new AsyncCommand(OnCameraOpenAsync);
            OpenGalleryCommand   = new AsyncCommand(OnGalleryOpenAsync);
            DeleteImageCommand   = new RelayCommand(OnDeleteImage);
            EditMessageCommand   = new RelayCommand <ChatMessageViewModel>(EditMessage);
            CancelEditingCommand = new RelayCommand(CancelEditing);
            SendMessageCommand   = new AsyncCommand(SendMessageAsync);
        }
예제 #4
0
        public ChatMessagesViewModel(
            IImagePickerService imagePicker,
            IPageNavigationService pageNavigationService,
            IChatLocalizedStrings localizedStrings,
            IFormatService formatService,
            ChatManager chatManager,
            ConnectionStatusViewModel connectionStatusViewModel)
        {
            _imagePicker           = imagePicker;
            _pageNavigationService = pageNavigationService;
            _localizedStrings      = localizedStrings;
            _formatService         = formatService;
            _chatManager           = chatManager;

            ConnectionStatus = connectionStatusViewModel;

            BackCommand     = new RelayCommand(_pageNavigationService.GoBack, () => _pageNavigationService.CanGoBack);
            ShowInfoCommand = new RelayCommand(ShowInfo);
        }
 public AddService()
 {
     InitializeComponent();
     populatelist();
     _imagePickerService = DependencyService.Get <IImagePickerService>();
 }