private void Canvas_Tap(object sender, GestureEventArgs e)
 {
     colorIndex++;
     if (colorIndex >= colors.Length)
         colorIndex = 0;
     globeBrush.Color = colors[colorIndex];
 }
 void MyMap_Tap(object sender, GestureEventArgs e)
 {
     if (_action != null)
     {
         _action.Tap(e);
     }  
 }
 void MyMap_Hold(object sender, GestureEventArgs e)
 {
     if (_action != null)
     {
         _action.Hold(e);
     }
 }
Esempio n. 4
0
 /// <summary>
 /// при нажатии происходит отправка сообщения
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void UIElement_OnTap(object sender, GestureEventArgs e)
 {
     var message = box.Text;
     WebClient wc = new WebClient();
     string uri = string.Format("https://api.vk.com/method/wall.post.xml?owner_id={0}&message={1}&access_token={2}", App.IdUser, message, App.AccessToken);
     wc.DownloadStringAsync(new Uri(uri));
 }
Esempio n. 5
0
        private void GestureListener_Tap(object sender, toolkit.GestureEventArgs e)
        {
            this.Cards.Add(AssociatedDeck.Deck.Cards[1]);
            AssociatedDeck.PopCard();


            if (firstCardHolder.Children.Count == 0)
            {
                firstCardHolder.Children.Add(new CardControl {
                    Card = this.Cards.Last()
                });
                return;
            }
            if (secondCardHolder.Children.Count == 0)
            {
                secondCardHolder.Children.Add(new CardControl {
                    Card = this.Cards.Last()
                });
                return;
            }
            if (thirdCardHolder.Children.Count == 0)
            {
                thirdCardHolder.Children.Add(new CardControl {
                    Card = this.Cards.Last()
                });

                //turn off the holder control
                var gestureListener = toolkit.GestureService.GetGestureListener(this);
                gestureListener.Tap -= new EventHandler <toolkit.GestureEventArgs>(GestureListener_Tap);
                return;
            }
        }
Esempio n. 6
0
 private void mailToDeveloper_Tap(object sender, GestureEventArgs e)
 {
     new EmailComposeTask {
       Subject = "Privacy Qeustion",
       To = "*****@*****.**"
       }.Show();
 }
Esempio n. 7
0
    private void OnCreatingCycleTile(object sender, GestureEventArgs e)
    {
      var cycleTile = new CycleTileData
      {
        Title = "Leipzig Impressionen",
        Count = 3,
        SmallBackgroundImage = new Uri("Assets/CycleTile/Tiles-2.jpg", UriKind.Relative),
        CycleImages = new List<Uri>
        {
          new Uri("Assets/CycleTile/Tiles-1.jpg", UriKind.Relative),
          new Uri("Assets/CycleTile/Tiles-2.jpg", UriKind.Relative),
          new Uri("Assets/CycleTile/Tiles-3.jpg", UriKind.Relative),
          new Uri("Assets/CycleTile/Tiles-4.jpg", UriKind.Relative),
          new Uri("Assets/CycleTile/Tiles-5.jpg", UriKind.Relative),
          new Uri("Assets/CycleTile/Tiles-6.jpg", UriKind.Relative),
          new Uri("Assets/CycleTile/Tiles-7.jpg", UriKind.Relative),
          new Uri("Assets/CycleTile/Tiles-8.jpg", UriKind.Relative),
          new Uri("Assets/CycleTile/Tiles-9.jpg", UriKind.Relative),
        }
      };

      ShellTile.Create(new Uri("/MainPage.xaml?shellTemplateType=CycleTemplate",
                      UriKind.Relative), 
                      cycleTile,
                      true);
    }
        private void piece_Tap(object sender, GestureEventArgs e)
        {
            //make this generic for all ellipses
            //dont rename refactor
            
            //try to set the target name property to the current piece
            //use the sender first

            Ellipse tmp = (Ellipse)sender;

            try
            {
                //call set value
                //tmp.Tag = "change theTag";
                //tmp.SetValue(Tag, "change the tag");

                //make sure the animation is stopped before reset
                pieceAnimation.Stop();
                //set the taRGETname property
                pieceAnimation.SetValue(Storyboard.TargetNameProperty, tmp.Name);
                //String curreE = pieceAnimation.GetValue(Storyboard.TargetNameProperty).ToString;
                pieceAnimation.Begin();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error encountered: " + System.Environment.NewLine + ex.Message);
                throw;
            }
        }
Esempio n. 9
0
        private void torchImage_Tap(object sender, GestureEventArgs e)
        {
            System.Diagnostics.Debug.WriteLine("click:" + cam.LampEnabled);
            //cam.LampEnabled = !cam.LampEnabled;
            if (cam.LampEnabled == true)
            {

                if (cam.IsRecording == false)
                {
                    // 打开.
                    cam.StartRecording();
                    BitmapImage ontorchimage = new BitmapImage(new Uri("/FlashLightTest;component/torch_pressed.png", UriKind.Relative));
                    torchImage.Source = ontorchimage;
                    lightImage.Visibility = Visibility.Visible;
                }
                else
                {
                    // 关闭
                    cam.StopRecording();
                    BitmapImage offtorchimage = new BitmapImage(new Uri("/FlashLightTest;component/torch_normal.png", UriKind.Relative));
                    torchImage.Source = offtorchimage;
                    lightImage.Visibility = Visibility.Collapsed;
                }
            }
        }
 private void RiverList_Tap(object sender, GestureEventArgs e)
 {
     var root = Application.Current.RootVisual as FrameworkElement;
     if (root == null) return;
     root.DataContext = RiverList.SelectedItem;
     NavigationService.Navigate(new Uri("/RiverDetail.xaml", UriKind.RelativeOrAbsolute));
 }
Esempio n. 11
0
        private async void OnLoadingFile(object sender, GestureEventArgs e)
        {
            var city = new City
            {
                Name = "Leipzig",
                State = "Saxony",
                Country = "Germany",
                Population = 550000
            };

            string json = JsonConvert.SerializeObject(city);

            var cityFile = 
              await ApplicationData.Current
                                   .LocalFolder.CreateFileAsync(
                                     "leipzig.city",
                                     CreationCollisionOption.ReplaceExisting);

            using (var stream = await cityFile.OpenAsync(FileAccessMode.ReadWrite))
            {
                using (var writer = new DataWriter(stream))
                {
                    writer.WriteString(json);
                    await writer.StoreAsync();
                }
            }

            Launcher.LaunchFileAsync(cityFile);
        }
Esempio n. 12
0
 private void pingme_DoubleTap(object sender, GestureEventArgs e)
 {
     ping = new PingHelper();
     ping.PingPongResponse += new PingHelper.PingPongResponseHandler(ping_PingPongResponse);
     ping.PingPushCoinServer();
     this.pong.Text = "... contacting PC";
 }
Esempio n. 13
0
        private void listview_Tap(object sender, GestureEventArgs e)
        {
            if (listview.SelectedItem.Equals("-------------------------------\n"))
            {
                MessageBox.Show("Selecione o nome corretamente");
                listview.IsEnabled = true;
            }
            else
            {
                listview.IsEnabled = false;
                //var lista = App.Visao.PesquisaPreço((string)listview.SelectedItem);

                string aux = "";
                string NomeProd = (string)listview.SelectedItem;

                /*foreach (var item in NomeProd)
                {
                    if (!item.Equals('\n'))
                        aux += item;
                    else
                        aux += ' ';
                }*/

                //Resultados result = new Resultados(lista);

                var app = (Application.Current as App);
                //Adicionamos o Texto na Variável Global
                app.ParametroProduto = NomeProd;
                //Chamamos a página que receberá o Dado
                NavigationService.Navigate(new Uri("/ResultadoPrecos.xaml", UriKind.Relative));
            }
        }
Esempio n. 14
0
        private void CommandeAnnales_Tap(object sender, GestureEventArgs e)
        {
            button1.Visibility = Visibility.Collapsed;
            loginCommande.Visibility = Visibility.Collapsed;
            TexteAnnales.Visibility = Visibility.Visible;
            TexteAnnales.Text = "Envoi de la commande...";

            if (panier.Count == 0 || panier.Count > 8)
            {
                TexteAnnales.Text = "Choisissez entre 1 et 8 UVs.";
                Perform(() => finCommande(), 2000);
                return;
            }

            var client = new WebClient();
            var texte = "login="******"&annales=";
            int i = 0;
            foreach (string nom in panier)
            {
                if (i > 0)
                {
                    texte += ",";
                }
                texte += nom;
                i++;
            }
            //client.UploadStringCompleted += new UploadStringCompletedEventHandler(handlerCommande);
            client.OpenReadCompleted += new OpenReadCompletedEventHandler(handlerCommande);
            client.OpenReadAsync(new Uri("http://assos.utc.fr/polar/annales/json?" + texte));
            //client.UploadStringAsync(new Uri("http://assos.utc.fr/polar/annales/borne?commander"), texte);
        }
Esempio n. 15
0
 void Article_Tap(object sender, GestureEventArgs e)
 {
     Image src = (Image)sender;
     string imgsrc = src.Tag.ToString();
     imgsrc = HttpUtility.UrlEncode(imgsrc);
     NavigationService.Navigate(new Uri("/pages/petdetails.xaml?src="+imgsrc,UriKind.Relative));
 }
        private void Button_Tap(object sender, GestureEventArgs e)
        {
            var button = (Button)sender;
            var viewModelItem = (ItemViewModel)button.Tag;

            viewModelItem.SubMenuIsVisible = !viewModelItem.SubMenuIsVisible;
        }
Esempio n. 17
0
 private void gistTile_Tap(object sender, GestureEventArgs e)
 {
     Dispatcher.BeginInvoke(() =>
     {
         NavigationService.Navigate(new Uri("/MainPages/GistPage.xaml", UriKind.Relative));
     });
 }
Esempio n. 18
0
 private void _2_Tap(object sender, GestureEventArgs e)
 {
     if (checkfun(_2.Text))
     {
         _2.Opacity = 0.3;
     }
 }
        private void RouteDirection_Tap(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            RouteStops routeStops = (sender as FrameworkElement).DataContext as RouteStops;

            viewModel.CurrentViewState.CurrentRoutes = new List <Route>()
            {
                (Route)routeStops.route
            };

            viewModel.CurrentViewState.CurrentRoute          = routeStops.route;
            viewModel.CurrentViewState.CurrentRouteDirection = routeStops;

            viewModel.CurrentViewState.CurrentStop = viewModel.CurrentViewState.CurrentRouteDirection.stops[0];
            foreach (Stop stop in viewModel.CurrentViewState.CurrentRouteDirection.stops)
            {
                // TODO: Make this call location-unknown safe.  The CurrentLocation could be unknown
                // at this point during a tombstoning scenario
                GeoCoordinate location = viewModel.LocationTracker.CurrentLocation;

                if (viewModel.CurrentViewState.CurrentStop.CalculateDistanceInMiles(location) > stop.CalculateDistanceInMiles(location))
                {
                    viewModel.CurrentViewState.CurrentStop = stop;
                }
            }

            Navigate(new Uri("/DetailsPage.xaml", UriKind.Relative));
        }
Esempio n. 20
0
        //private void RefreshTransferProgressUI()
        //{
        //    String progressMessage = "";
        //    if (_currentRequest != null)
        //    {
        //        progressMessage = String.Format("Progress: {0} bytes / {1} bytes",
        //            _currentRequest.BytesReceived, _currentRequest.TotalBytesToReceive);
        //    }

        //    progressText.Text = progressMessage;
        //}
        //===================================  blob 相关函数定义



        //划动手势的定义

        private void GestureListenerFlick_ECG(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {//在此处传递的参数应当包含病人的ID,等到整合时要填上
            if (textBlock_Status.Text == "Completed")
            {
                this.NavigationService.Navigate(new Uri("/PatientDescription.xaml", UriKind.Relative));
            }
        }
        public void OnBeginSelectingDifferentHero(object sender, GestureEventArgs e)
        {
            var selectedProfile = sender as HeroProfileInHeroBox;
            _teamSlotToModify = (int)selectedProfile.TeamSlot;

            AvailableHeroes.Visibility = Visibility.Visible;
            TeamStats.Visibility = Visibility.Collapsed;
        }
 private void CompletedQuestionsList_Tap(object sender, GestureEventArgs e)
 {
     var selectedQuestion = CompletedQuestionsList.SelectedItem as Question;
     if (selectedQuestion != null)
     {
         App.RootFrame.Navigate(new Uri("/View/QuestionResultPage.xaml?" + selectedQuestion.Id, UriKind.Relative));
     }
 }
Esempio n. 23
0
 private void GestureListener_DoubleTap(object sender, GestureEventArgs e)
 {
     Secret.Domain.Data obj = ((sender as System.Windows.Controls.Border).DataContext as Secret.Domain.Data);
     if (obj != null)
     {
         this.NavigationService.Navigate(new System.Uri("/Control/Detail.xaml?tag=" + obj.id, System.UriKind.Relative));
     }
 }
Esempio n. 24
0
 private void gridReset_Tap(object sender, GestureEventArgs e)
 {
     if (MessageBox.Show("This action will restart all your data. Are you sure you want to continue ?", "Warning !", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
     {
         category = "reset";
         ShowPopup();
     }
 }
Esempio n. 25
0
        private void ContactResultsData_Tap(object sender, GestureEventArgs e)
        {
            App.con = ((sender as ListBox).SelectedValue as Contact);
            AppointmentManager am = new AppointmentManager();

            am.FreeTimesAvailable += SendToServer;
            am.GetFreeTime();
        }
 private void image_Tap(object sender, GestureEventArgs e)
 {
     Image image = (Image)sender;
     string file = image.Tag.ToString();
     file = file.Substring(0, file.LastIndexOf('_'));
     file = file + ".jpg";
     NavigationService.Navigate(new Uri("/FullView.xaml?msg=" + file, UriKind.Relative));
 }
Esempio n. 27
0
 void SetRowCount(object sender, GestureEventArgs e)
 {
     resetBorders(rowButtons);
     Int32 x = Int32.Parse(((Button)sender).Content.ToString());
     Abacus.rowsCountSettings = x;
     System.Diagnostics.Debug.WriteLine(x);
     setAsSelected((Button)sender); 
 }
Esempio n. 28
0
        private void ViewRun_Tap(object sender, GestureEventArgs e)
        {
            footfallManager.currentPassiveRun = ((Activity)((StackPanel)sender).Tag);

            System.Diagnostics.Debug.WriteLine("name " + footfallManager.currentPassiveRun.title);

            this.NavigationService.Navigate(new Uri("/ViewRunPage.xaml", UriKind.Relative));
        }
Esempio n. 29
0
 private void tbson_DoubleTap(object sender, GestureEventArgs e)
 {
     if (tbson.Text != "")
     {
         Clipboard.SetText(tbson.Text);
         MessageBox.Show("Son şifreniz panoya başarıyla kopyalandı.");
     }
 }
Esempio n. 30
0
        private void Customer_Tap(object sender, GestureEventArgs e)
        {
            var customer = ((FrameworkElement) sender).DataContext as Customer;
            if (customer == null)
                return;

            NavigationService.Navigate(new Uri("/EditCustomerPage.xaml?customerId=" + customer.Id, UriKind.Relative));
        }
Esempio n. 31
0
        protected void GestureListener_Hold(object sender, GestureEventArgs e)
        {
            // sender is the StackPanel in this example
            var item = ((Grid)sender).DataContext;

            // item has the type of the model
            SelectedItem = item as Happening;
        }
Esempio n. 32
0
 private void Button_OnTap(object sender, GestureEventArgs e)
 {
     // Request webcam access and start the capturing
     if (CaptureDeviceConfiguration.RequestDeviceAccess())
     {
         c.Start();
     }
 }
Esempio n. 33
0
        private void imgResult_Tap(object sender, GestureEventArgs e)
        {
            //Si premier clic, on enrgistre le X et le Y
            if (clic1)
            {
                tmp.X = Convert.ToInt32(e.GetPosition(imgResult).X);
                tmp.Y = Convert.ToInt32(e.GetPosition(imgResult).Y);

                //On affiche le premier point
                e1.Margin = new Thickness(tmp.X, tmp.Y, 0, 0);
                e1.Visibility = Visibility.Visible;

                clic1 = false;
                clic2 = true;

                return;
            }

            //Si second clic, on enregistre longeur et largeur
            if (clic2)
            {
                //Longueur
                int x = Convert.ToInt32(e.GetPosition(imgResult).X);

                if (tmp.X > x)
                {
                    MessageBox.Show("This point should be the corner on the down right", "Error", MessageBoxButton.OK);
                }
                else
                {
                    tmp.Longueur = x - tmp.X;
                    int y = Convert.ToInt32(e.GetPosition(imgResult).Y);

                    if (tmp.Y > y)
                    {
                        MessageBox.Show("This point should be the corner on the down right", "Error", MessageBoxButton.OK);
                    }
                    else
                    {
                        tmp.Hauteur = y - tmp.Y;
                        clic2 = false;

                        //On enlève l'ellipse
                        e1.Visibility = Visibility.Collapsed;

                        //On affiche le rectable
                        r1.Margin = new Thickness(e1.Margin.Left + 10, e1.Margin.Top +6,0,0);
                        r1.Width = tmp.Longueur;
                        r1.Height = tmp.Hauteur;
                        r1.Visibility = Visibility.Visible;

                        //On choisit l'objet
                        objet = true;
                        ContentPanelItem.Visibility = Visibility.Visible;
                    }
                }
            }
        }
Esempio n. 34
0
        void GestureListener_Doubletap(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            var transformNormal = (CompositeTransform)img.RenderTransform;

            transformNormal.ScaleX = 1.0;
            transformNormal.ScaleY = 1.0;
            img.RenderTransform    = transformNormal;
            isOrizinal             = true;
        }
Esempio n. 35
0
 private void GestureListener_OnDoubleTap(object sender, GestureEventArgs e)
 {
     ImageTransformation.ScaleX     = 1;
     ImageTransformation.ScaleY     = 1;
     ImageTransformation.CenterY    = 0;
     ImageTransformation.CenterY    = 0;
     ImageTransformation.TranslateX = 0;
     ImageTransformation.TranslateY = 0;
 }
        void TapOnPlacemark(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            GeoPlacemark place = (GeoPlacemark)(((StackPanel)sender).DataContext);

            DestinationTextBlock.Text     = place.Name;
            NextDirectionTextBlock.Text   = "calculating ...";
            NavigateParentGrid.Visibility = Visibility.Visible;
            augmentedReality.SwitchToNavigator(place);
        }
Esempio n. 37
0
        private void ItemTapped(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            _selecteditem = pagelist.SelectedItem as Page;

            if (_selecteditem != null)
            {
                MessageBox.Show(_selecteditem.Title + " Tapped...");
            }
        }
Esempio n. 38
0
        private void OnHold(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            //transform.TranslateX = transform.TranslateY = 0;
            transform.ScaleX   = transform.ScaleY = 1;
            transform.Rotation = 0;

            //flickData.Text = string.Format("OnHoldGestureEvent");
            // Collapse PageTitle
            PageTitleCollapse();
        }
Esempio n. 39
0
        // private int GetBeforeIndex(object sender, RoutedEventArgs e)
        // {
        //     return
        // }

        private void GestureListenerTap(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            //  if(listBox_PatientsList.SelectedItem==null)
            //    if (this.listBox_PatientsList== listBox_PatientsList.SelectedItem)
            //  {
            // 在此处应添加病人ID,并作为参数传递
            this.NavigationService.Navigate(new Uri("/Record.xaml", UriKind.Relative));

            //   }
        }
Esempio n. 40
0
 private void onDragStarted(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
 {
     if (disableTopLevelGesture || isReordering || isDraggingListBox)
     {
         return;
     }
     e.Handled         = true;
     isDraggingListBox = true;
     lastDraggedYDist  = 0.0;
     dragStartY        = e.GetPosition((UIElement)listbox).Y;
 }
Esempio n. 41
0
        private void ConnectToSelected_Tap_1(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            // Because I enable the ConnectToSelected button only if the user has
            // a device selected, I don't need to check here whether that is the case.

            // Connect to the device
            PairedDeviceInfo pdi  = PairedDevicesList.SelectedItem as PairedDeviceInfo;
            PeerInformation  peer = pdi.PeerInfo;

            // Asynchronous call to connect to the device
            ConnectToDevice(peer);
        }
        public static void Hold(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            FrameworkElement fe     = sender as FrameworkElement;
            double           offset = fe.GetHorizontalOffset().Value;

            if (offset >= 0)
            {
                MenuOpen(fe);
            }
            else
            {
                MenuBounceBack(fe);
            }
        }
Esempio n. 43
0
        private void ConnectToSelected_Tap_1(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            if (PeerList.SelectedItem == null)
            {
                MessageBox.Show(AppResources.Err_NoPeer, AppResources.Err_NoConnectTitle, MessageBoxButton.OK);
                return;
            }

            // Connect to the selected peer.
            PeerAppInfo     pdi  = PeerList.SelectedItem as PeerAppInfo;
            PeerInformation peer = pdi.PeerInfo;

            ConnectToPeer(peer);
        }
Esempio n. 44
0
        private void GestureListener_Hold(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            _selecteditem = pagelist.SelectedItem as Page;

            if (_sendertemp != null)
            {
                FrameworkElement fe = _sendertemp as FrameworkElement;
                SwipeMenu.MenuBounceBack(fe);
            }

            _sendertemp = sender;

            SwipeMenu.Hold(sender, e);
        }
Esempio n. 45
0
 void gl_DoubleTap(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
 {
     if (gameGrid.Height == 480 * 2)
     {
         gameGrid.Height = double.NaN;
         gameGrid.Width  = double.NaN;
     }
     else
     {
         gameGrid.Height = 480 * 2;
         gameGrid.Width  = 800 * 2;
     }
     //scale.ScaleX = 2;
     //scale.ScaleY = 2;
 }
Esempio n. 46
0
        private void GestureListener_Hold(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            var     pushpinLocation = googlemap.ViewportPointToLocation(e.GetPosition(googlemap));
            Pushpin pushpin         = new Pushpin
            {
                Location = pushpinLocation,
                Template = Application.Current.Resources["PushpinControlTemplate"] as ControlTemplate,
                Content  = "1"
            };

            if (googlemap.Children.Any(p => p is Pushpin))
            {
                googlemap.Children.Remove(googlemap.Children.Single(p => p is Pushpin));
            }
            googlemap.Children.Add(pushpin);
            EnableProceedButton();
        }
Esempio n. 47
0
 void viewfinder_Tapped(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
 {
     if (cam != null)
     {
         try
         {
             cam.CaptureImage();
         }
         catch (Exception ex)
         {
             this.Dispatcher.BeginInvoke(delegate()
             {
                 txtMessage.Text = ex.Message;
             });
         }
     }
 }
Esempio n. 48
0
 private void onDragCompleted(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
 {
     if (_disableTopLevelGesture || !_isDraggingListBox)
     {
         return;
     }
     _isDraggingListBox = false;
     if (!_isAddingItemViaDragTop)
     {
         return;
     }
     if (TransformUtil.GetScaleY((FrameworkElement)_newItem) < 0.7)
     {
         itemGrid.Children.Remove((UIElement)_newItem);
     }
     else
     {
         TransformUtil.SetScaleY((FrameworkElement)_newItem, 1.0);
         TransformUtil.setRotateX((FrameworkElement)_newItem, 0.0);
         TransformUtil.setScaleX((FrameworkElement)_newItem, 1.0);
         TransformUtil.setTranslateX((FrameworkElement)_newItem, 0.0);
         _newItem.Tag = CurrItem.Add();
         if (_newItem.Tag == null)
         {
             itemGrid.Children.Remove((UIElement)_newItem);
         }
         else
         {
             _newItem.Update();
             //sortZIndex();
             _newItem.SetText("");
             _newItem.text.Focus();
         }
     }
     UpdateItemGridHeight();
     for (int idx = IndexOfItem(_newItem) + 1; idx < itemGrid.Children.Count; ++idx)
     {
         TransformUtil.setTranslateY((FrameworkElement)itemGrid.Children[idx], IdxToPosition(idx));
     }
     _newItem = (ItemUI)null;
     _isAddingItemViaDragTop = false;
     EnableNativeScrolling(true);
     EnableAllChildrenGesture(true);
 }
Esempio n. 49
0
 private void onDragStarted(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
 {
     if (DisableGesture)
     {
         return;
     }
     if (_reorderStarted)
     {
         e.Handled = true;
     }
     else
     {
         if (_draggingToDelete)
         {
             return;
         }
         _dragStartX = e.GetPosition(this).X;
     }
 }
Esempio n. 50
0
        private void GestureListener_DoubleTap(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            if (Math.Abs(_totalImageScale - 1) < .0001)
            {
                const double DOUBLE_TAP_ZOOM_IN = 3;
                double       imageScale         = Math.Min(DOUBLE_TAP_ZOOM_IN, _maxImageZoom);

                Point imagePositionTapped = e.GetPosition(MapImage);
                // we want this point to be centered.
                double x          = imagePositionTapped.X * imageScale - (MapImage.ActualWidth / 2);
                double y          = imagePositionTapped.Y * imageScale - (MapImage.ActualHeight / 2);
                Point  imageDelta = new Point(-1 * x, -1 * y);
                // FFV - animation?
                UpdateImageScale(imageScale);
                UpdateImagePosition(imageDelta);
            }
            else
            {
                ResetImagePosition();
            }
        }
Esempio n. 51
0
        private void onDragCompleted(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            if (disableTopLevelGesture || !isDraggingListBox)
            {
                return;
            }
            isDraggingListBox = false;
            if (!isAddingItemViaDragTop)
            {
                return;
            }

            //Debug.WriteLine("add items");
            //App.Current.ListItems.StartNode.Add();

            //if (TransformUtil.getScaleY((FrameworkElement)newItem) < 0.7)
            //{
            //    itemList.Remove(this.newItem);
            //    itemsPanel.Children.Remove((UIElement)newItem);
            //}
            //else
            //{
            //    TransformUtil.setScaleY((FrameworkElement)newItem, 1.0);
            //    TransformUtil.setRotateX((FrameworkElement)newItem, 0.0);
            //    TransformUtil.setScaleX((FrameworkElement)newItem, 1.0);
            //    TransformUtil.setTranslateX((FrameworkElement)newItem, 0.0);
            //    //sortZIndex();
            //    newItem.setText("");
            //    newItem.text.Focus();
            //}
            //updateItemGridHeight();
            //for (int idx = indexOfItem(newItem) + 1; idx < itemList.Count; ++idx)
            //    TransformUtil.setTranslateY((FrameworkElement)itemList[idx], idxToPosition(idx));
            //newItem = (ItemUI)null;
            //isAddingItemViaDragTop = false;
            //enableNativeScrolling(true);
            //enableAllChildrenGesture(true);
        }
Esempio n. 52
0
        private void GestureListener_Tap(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            WebBrowserTask wbt = new WebBrowserTask();

            if (e.OriginalSource == this.twitterButton)
            {
                wbt.Uri = new Uri("http://twitter.com/vikeshkhanna");
            }
            else if (e.OriginalSource == this.facebookButton)
            {
                wbt.Uri = new Uri("http://facebook.com/vikeshkhanna");
            }
            else if (e.OriginalSource == this.quoraButton)
            {
                wbt.Uri = new Uri("http://quora.com/Vikesh-Khanna");
            }
            else if (e.OriginalSource == this.bbButton)
            {
                wbt.Uri = new Uri("http://bodybuilding.com");
            }

            wbt.Show();
        }
Esempio n. 53
0
 private void onDragCompleted(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
 {
     if (this.disableGesture)
     {
         return;
     }
     if (this.reorderStarted)
     {
         if (e != null)
         {
             e.Handled = true;
         }
         this.listbox.onReorderCompleted(this);
     }
     else
     {
         if (!this.draggingToDelete)
         {
             return;
         }
         if (e != null)
         {
             e.Handled = true;
         }
         this.draggingToDelete = false;
         this.listbox.onDraggingToDeleteEnded();
         double translateX = TransformUtil.getTranslateX((FrameworkElement)LayoutRoot);
         if (translateX > -150.0 || MessageBox.Show("Delete list", "Are you sure?", MessageBoxButton.OKCancel) == MessageBoxResult.Cancel)
         {
             AnimationUtil.translateX((FrameworkElement)LayoutRoot, translateX, 0.0, 100, (Action <object, EventArgs>)null);
         }
         else
         {
             AnimationUtil.translateX((FrameworkElement)LayoutRoot, translateX, -this.ActualWidth, 100, (Action <object, EventArgs>)((s, ev) => this.listbox.onDeleteItem(this)));
         }
     }
 }
Esempio n. 54
0
 private void onDragCompleted(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
 {
     if (disableTopLevelGesture || !isDraggingListBox)
     {
         return;
     }
     isDraggingListBox = false;
     if (!isAddingItemViaDragTop)
     {
         return;
     }
     if (TransformUtil.getScaleY((FrameworkElement)newItem) < 0.7)
     {
         itemList.Remove(this.newItem);
         itemGrid.Children.Remove((UIElement)newItem);
     }
     else
     {
         TransformUtil.setScaleY((FrameworkElement)newItem, 1.0);
         TransformUtil.setRotateX((FrameworkElement)newItem, 0.0);
         TransformUtil.setScaleX((FrameworkElement)newItem, 1.0);
         TransformUtil.setTranslateX((FrameworkElement)newItem, 0.0);
         //sortZIndex();
         newItem.setText("");
         newItem.text.Focus();
     }
     updateItemGridHeight();
     for (int idx = indexOfItem(newItem) + 1; idx < itemList.Count; ++idx)
     {
         TransformUtil.setTranslateY((FrameworkElement)itemList[idx], idxToPosition(idx));
     }
     newItem = (ItemUI)null;
     isAddingItemViaDragTop = false;
     enableNativeScrolling(true);
     enableAllChildrenGesture(true);
 }
Esempio n. 55
0
        private void GestureListener_Tap(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            MeterMobile selectedMeter = lbxMeters.SelectedItem as MeterMobile;

            this.Content = new ReadingPage(selectedMeter);
        }
Esempio n. 56
0
 /// <summary>
 /// Resets the image scaling and position
 /// </summary>
 private void OnDoubleTap(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
 {
     ResetImagePosition();
 }
Esempio n. 57
0
 private void Combinaciones_Tap_1(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
 {
     //Combinaciones.Fill = new SolidColorBrush(Colors.White);
     nombreAnterior = "asd";
 }
Esempio n. 58
0
 private void FindPairedDevices_Tap(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
 {
     RefreshPairedDevicesList();
 }
Esempio n. 59
0
 private void OnHold(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
 {
     transform.TranslateX = transform.TranslateY = 0;
     transform.ScaleX     = transform.ScaleY = 1;
     transform.Rotation   = 0;
 }
Esempio n. 60
0
 private void FindPeers_Tap(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
 {
     RefreshPeerAppList();
 }