private void InitDetailsHeader() { _chatDetailsHeaderView = new ChatDetailsHeaderView(new CGRect(0, 0, 200, 300)); _chatDetailsHeaderView.EnableEditMode(false); _chatDetailsHeaderView.ChatNamePlaceholder = ViewModel.LocalizedStrings.ChatName; _chatDetailsHeaderView.SetAddMembersCommand(ViewModel.AddMembersCommand, ViewModel.LocalizedStrings.AddMembers); _chatDetailsHeaderView.SetChangeMuteNotificationsCommand( ViewModel.HeaderViewModel.ChangeMuteNotificationsCommand, ViewModel.LocalizedStrings.Notifications); _simpleImagePicker = new SimpleImagePicker(this, Dependencies.Container.Resolve <IPermissionsManager>(), false) { MaxImageWidth = 280, MaxImageHeight = 280 }; }
private void InitDetailsHeader() { _chatDetailsHeaderView = new ChatDetailsHeaderView(new CGRect(0, 0, 200, 250)); _chatDetailsHeaderView.EnableEditMode(true); _chatDetailsHeaderView.HideMuteContainer(); _chatDetailsHeaderView.ChatNamePlaceholder = ViewModel.LocalizedStrings.ChatName; _chatDetailsHeaderView.SetChangeChatPhotoCommand(new RelayCommand(OpenPicker), ViewModel.LocalizedStrings.ChangePhoto); _chatDetailsHeaderView.SetAddMembersCommand(ViewModel.AddMembersCommand, ViewModel.LocalizedStrings.AddMembers); _chatDetailsHeaderView.SetChatAvatar(null, string.Empty); _simpleImagePicker = new SimpleImagePicker(this, Dependencies.Container.Resolve <IPermissionsManager>(), false) { MaxImageWidth = 280, MaxImageHeight = 280 }; }
public void ViewDidLoad(UIViewController viewController) { SendButton.TintColor = StyleHelper.Style.ButtonTintColor; SendButton.SetImage(UIImage.FromBundle(StyleHelper.Style.SendBundleName), UIControlState.Normal); SendButton.SetCommand(new RelayCommand(OnRaiseSend)); AttachImageButton.TintColor = StyleHelper.Style.ButtonTintColor; AttachImageButton.SetImage(UIImage.FromBundle(StyleHelper.Style.AddImageBundleName), UIControlState.Normal); AttachImageButton.SetCommand(new RelayCommand(OnAddPhotoClicked)); TakePhotoButton.TintColor = StyleHelper.Style.ButtonTintColor; TakePhotoButton.SetImage(UIImage.FromBundle(StyleHelper.Style.TakePhotoBundleName), UIControlState.Normal); TakePhotoButton.SetCommand(new RelayCommand(OnTakePhotoClicked)); RemoveAttachButton.SetImage(UIImage.FromBundle(StyleHelper.Style.RemoveAttachBundleName), UIControlState.Normal); RemoveAttachButton.SetCommand(new RelayCommand(OnRemovePhotoClicked)); AttachedImageView.Layer.MasksToBounds = false; AttachedImageView.Layer.CornerRadius = 5; AttachedImageView.ClipsToBounds = true; AttachedImageView.ContentMode = UIViewContentMode.ScaleAspectFill; EditImageContainer.Hidden = true; EditImageContainerHeightConstraint.Constant = 0; _simpleImagePicker = new SimpleImagePicker(viewController, Dependencies.Container.Resolve <IPermissionsManager>(), false); _attachedImageBinding = this.SetBinding(() => _simpleImagePicker.ViewModel.ImageCacheKey).WhenSourceChanges( () => { if (string.IsNullOrEmpty(_simpleImagePicker.ViewModel.ImageCacheKey)) { CloseAttachPanel(); return; } OpenAttachPanel(); }); _simpleImagePicker.SetCommand(nameof(_simpleImagePicker.PickerWillOpen), new RelayCommand(RaisePickerWillOpen)); }