Ejemplo n.º 1
0
		void GoToPhotoDetailsView (UIActivity activity)
		{			
			Image image = activity.Image;
			int imgUserId = activity.Image.UserId;			
			int askerId = AppDelegateIPhone.AIphone.MainUser.Id;
			
			FullUserResponse user =  imgUserId == askerId 
				? new FullUserResponse()
				{ 
					User = AppDelegateIPhone.AIphone.MainUser 
				}
				: AppDelegateIPhone.AIphone.UsersServ.GetFullUserById(imgUserId, askerId);
			
			Action act = ()=>
			{
				try
				{
					this.InvokeOnMainThread(()=>
					{
						var a = new PhotoDetailsViewController(MSPNavigationController, user, image, true);
						MSPNavigationController.PresentModalViewController (a, true);
					});
				}
				catch (Exception ex)
				{
					Util.ShowAlertSheet(ex.Message, View);
					Util.LogException("GoToPhotoDetailsView", ex);
					return;
				}
			};
			AppDelegateIPhone.ShowRealLoading(View, "Loading photo details", null, act);
		}
Ejemplo n.º 2
0
		public void OnPhotoClicked(Image photo)
		{
			if (photo == null || image != null)
			{
				return;
			}			
			
			if (_MSP != null)
				_MSP.DismissModalViewControllerAnimated(true);
			
			Action act = () =>
			{
				int askerId = AppDelegateIPhone.AIphone.GetMainUserId();
				FullUserResponse fullUser = AppDelegateIPhone.AIphone.UsersServ.GetFullUserById(photo.UserId, askerId);
				InvokeOnMainThread(()=>				                   
				{
					var nav = AppDelegateIPhone.tabBarController == null ? AppDelegateIPhone.AIphone.GetCurrentNavControler() 
								: (UINavigationController)AppDelegateIPhone.tabBarController.SelectedViewController;
					
					var a = new PhotoDetailsViewController(nav, fullUser, photo, false);
					nav.PushViewController(a, true);
				});
			};
			
			AppDelegateIPhone.ShowRealLoading(View, "Loading photo details", null, act);
		}
Ejemplo n.º 3
0
		private void LoadPhoto(Image image)
		{
			Action act = ()=>
			{			
				try
				{
					int askerId = AppDelegateIPhone.AIphone.GetMainUserId();
					FullUserResponse fullUser = AppDelegateIPhone.AIphone.UsersServ.GetFullUserById(image.UserId, askerId);					
					if (fullUser == null)
						return;
					
					BeginInvokeOnMainThread(()=>
					{
						var a = new PhotoDetailsViewController(_MSP, fullUser, image, false);
						_MSP.PushViewController(a, true);
					});
				}
				catch (Exception ex)
				{
					Util.LogException("OnPhotoClicked", ex);
				}
			};
			AppDelegateIPhone.ShowRealLoading(View, "Loading photo details", null, act);			
		}
Ejemplo n.º 4
0
			private void OnImageClicked(object sender, EventArgs e)
			{
				Image img = null;
				for (int i = 0; i < buttons.Count; i++)
				{
					if (buttons[i] == (UIButton)sender)
					{
					 	img  = copy.Images[i].Img;
						break;
					}
				}
				if (img == null)
					return;
				
				
				var _MSP = AppDelegateIPhone.tabBarController.SelectedViewController as MSPNavigationController;
				var searchModal = _MSP.ModalViewController;
				//_MSP.DismissModalViewControllerAnimated(false);
				
				Action act = ()=>
				{			
					try
					{
						int askerId = AppDelegateIPhone.AIphone.GetMainUserId();
						FullUserResponse fullUser = AppDelegateIPhone.AIphone.UsersServ.GetFullUserById(img.UserId, askerId);
						if (fullUser == null)
							return;
						
						Action backAct = () =>
						{
							//_MSP.PresentModalViewController(searchModal, true);
						};
						
						BeginInvokeOnMainThread(()=>
						{
							var a = new PhotoDetailsViewController(_MSP, fullUser, img, false, backAct);
							_MSP.PushViewController(a, true);							
							//_MSP.PresentModalViewController(a, true);
						});
					}
					catch (Exception ex)
					{
						Util.LogException("OnPhotoClicked", ex);
					}
				};
				AppDelegateIPhone.ShowRealLoading(null, "Loading photo details", null, act);
			}