当前位置: 首页>>代码示例>>C#>>正文


C# GestureEventArgs类代码示例

本文整理汇总了C#中GestureEventArgs的典型用法代码示例。如果您正苦于以下问题:C# GestureEventArgs类的具体用法?C# GestureEventArgs怎么用?C# GestureEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GestureEventArgs类属于命名空间,在下文中一共展示了GestureEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnDungeonSelected

        public void OnDungeonSelected(object sender, GestureEventArgs e)
        {
            var selectedGrid = sender as Grid;
            var dungeonId = (int)selectedGrid.Tag;
            _selectedDungeon = GetDungeon(dungeonId);

            var heroRepository = new HeroRepository();
            _heroesOwnedByPlayer = heroRepository.GetHeroesOwnedByPlayer().Count;

            var playerRepository = new PlayerRepository();
            _player = playerRepository.GetPlayer();

            if (PlayerCanEnterDungeon())
            {
                _player.Stam.Current = _player.Stam.Current - _selectedDungeon.StaminaCost;
                playerRepository.SavePlayer(_player);
                MessageBus.Default.Notify("EnterDungeon", new Object(), new NotificationEventArgs(dungeonId.ToString()));
            }
            else
            {
                var errorModalControl = GetErrorMessage();
                var errorModal = new ModalContainer(errorModalControl);
                errorModal.Show();
            }
        }
开发者ID:richhildebrand,项目名称:PuzzleRpg,代码行数:25,代码来源:DungeonSelector.xaml.cs

示例2: LayoutRootTap

 private void LayoutRootTap(object sender, GestureEventArgs e)
 {
     if (TapAvatar != null)
     {
         TapAvatar(tbUserName.Text);
     }
 }
开发者ID:chwzou,项目名称:WP7Fanfou,代码行数:7,代码来源:UserAvatar.xaml.cs

示例3: HoldGesture

        private void HoldGesture(object sender, GestureEventArgs e)
        {
            if (!IsEnabled)
                return;

            IsActive = true;

            _cardView = sender as CardView;
            if (_cardView == null)
            {
                IsActive = false;
            }
            else
            {
                var selected = (CardViewModel)_cardView.DataContext;

                var scrollOffset = new Point(_scrollViewer.HorizontalOffset, _scrollViewer.VerticalOffset);
                _originalRelativePosition = _cardView.GetRelativePositionIn(_context, scrollOffset);

                // Fade everything out
                //if (_context != null)
                //    _context.Animate(1.0, 0.7, UIElement.OpacityProperty, 300, 0);

                if (_context != null)
                    FadeCards(_context, selected);

                // Popout the selected card
                // PopoutCard(_cardView, _draggedImage, _originalRelativePosition, scrollOffset);

                // We can allow children to listen to events now
                EnableChildInteractions();
            }
        }
开发者ID:Bunk,项目名称:trellow,代码行数:33,代码来源:HoldCardInteraction.cs

示例4: OnTap

        private void OnTap(object sender, GestureEventArgs e)
        {
            if (Command == null)
                return;

            Command.Execute(CommandParameter);
        }
开发者ID:Coolerhino,项目名称:MvvmCross-Tutorials,代码行数:7,代码来源:IconWithTextMenuItem.xaml.cs

示例5: AddEventItem

        public void AddEventItem(object sender, GestureEventArgs e)
        {
            Grid grid = sender as Grid;
            Point point = e.GetPosition(grid);

            string eventTitle = " + New title event";
            double width = (grid.Parent as ScrollViewer).Width - 50;

            DateTime dateTime = _lastItem.ItemDate;
            int hour = (int)Math.Ceiling((point.Y) / Constants.GRID_HOURS_CELL_HEIGHT);
            EventItem eventItem = new EventItem()
               {
                   EventColor = CustomColor.CornflowerBlue,
                   EventStart = new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, hour, 0, 0),
                   EventEnd = new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, hour + 1, 0, 0),
                   EventTitle = eventTitle,
                   EventLocation = string.Empty
               };

            DailyDetailItem eventDetails = new DailyDetailItem(eventItem);
            eventDetails.Click += EditEvent;

            _lastItem.EventsForDay.Add(eventItem);

            eventDetails.SetValue(Grid.RowProperty, hour);
            eventDetails.SetValue(Grid.RowSpanProperty, 1);
            eventDetails.SetValue(Grid.ColumnProperty, 1);
            grid.Children.Add(eventDetails);
        }
开发者ID:agzagrean,项目名称:MyCalendar,代码行数:29,代码来源:Calendar_AddEditItem.cs

示例6: lstFriends_Tap

        async void lstFriends_Tap(object sender, GestureEventArgs e)
        {
            if (lstFriends.SelectedItem != null)
            {
                
                FacebookUser selectedFriend = lstFriends.SelectedItem as FacebookUser;
                Permission permission = new Permission();

                MessageBoxResult result = MessageBox.Show(
                    string.Format(AppResources.FriendAddView_Txt_FriendAddQuestion,selectedFriend.Name),
                    AppResources.FriendAddView_Txt_FriendAddTitle,
                    MessageBoxButton.OKCancel);

                if (result == MessageBoxResult.OK)
                {
                    permission.FBIDFromViewed = selectedFriend.Id;
                    permission.FBIDFromViewer = App.fbUserID;
                    permission.IsAllowed = false;
                    permission.PartitionKey = permission.FBIDFromViewer;
                    permission.RowKey = permission.FBIDFromViewed;
                    
                    bool addResult = await (this.DataContext as FriendAddViewModel).TryAddNewFriend(permission);
                    if (addResult)
                        MessageBox.Show(AppResources.FriendAddView_Txt_FriendAddSuccess,AppResources.FriendAddView_Txt_FriendAddTitle, MessageBoxButton.OK);
                    else MessageBox.Show(AppResources.FriendAddView_Txt_FriendAddError, AppResources.FriendAddView_Txt_FriendAddTitle, MessageBoxButton.OK);
                }   
            }
        }
开发者ID:JorgeCupi,项目名称:SmartGuard,代码行数:28,代码来源:FriendAddView.xaml.cs

示例7: Click

        private void Click(object sender, GestureEventArgs e)
        {
            Game game = (Game) ((FrameworkElement) sender).DataContext;
            if (game == null) return;

            NavigationService.Navigate(new Uri("/GameInfo.xaml?id=" + game.ID, UriKind.Relative));
        }
开发者ID:r-win,项目名称:XK3Y-Remote-Control,代码行数:7,代码来源:List.xaml.cs

示例8: ModifyCreation

    public void ModifyCreation(GestureEventArgs e)
    {
        var gesture = e.Sender as IPositionGesture;

        if (gesture != null)
        {
            var pos = gesture.GetGesturePosition(Hand.Both);
            CreatedInstance.transform.position = pos;
            lastGesturePositions.Add(pos);

            while (lastGesturePositions.Count > 5)
            {
                lastGesturePositions.RemoveAt(0);
            }

            var scale = GetScale(gesture);
            CreatedInstance.transform.localScale = scale;

            var rotation = GetRotation(gesture);
            CreatedInstance.transform.rotation = rotation;

            var rigidbody = CreatedInstance.GetComponent<Rigidbody>();
            rigidbody.mass = GetMass(scale);
        }
    }
开发者ID:SebiH,项目名称:BachelorProject,代码行数:25,代码来源:CreateObject.cs

示例9: Image_Tap

 private void Image_Tap(object sender, GestureEventArgs e)
 {
     var file = (RingtoneListItem)((Image)sender).DataContext;
     if (file != null && !file.DisplayName.Contains("none"))
     {
     #if ARM
         string fileName = Path.GetFileName(file.FullPath);
         try
         {
             // Copy file to the isf
             if (!_isoStore.FileExists(fileName))
             {
                 SystemTray.ProgressIndicator.IsVisible = true;
                 File.Copy(file.FullPath, Path.Combine(_isoRootPath, fileName), true);
             }
             using (IsolatedStorageFileStream isoStream = new IsolatedStorageFileStream(fileName, FileMode.Open, _isoStore))
             {
                 mediaElement.SetSource(isoStream);
                 mediaElement.Play();
                 SystemTray.ProgressIndicator.IsVisible = false;
             }
         }
         catch { }
     #else
         MessageBox.Show(file.FullPath);
     #endif
     }
 }
开发者ID:sensboston,项目名称:WPTweaker,代码行数:28,代码来源:RingtoneChooser.xaml.cs

示例10: RequestSMSButton_Tap

        private void RequestSMSButton_Tap(object sender, GestureEventArgs e)
        {
            GlobalIndicator.Instance.IsLoading = true;

            // Call sign up method again with filled additional parameter SID.
            _DoSignUp();
        }
开发者ID:optiklab,项目名称:VKMessanger,代码行数:7,代码来源:SignUpPage.xaml.cs

示例11: xItemBorder_Tap

 private void xItemBorder_Tap(object sender, GestureEventArgs e)
 {
     //Border border = sender as Border;
     //ChannelInfo channelInfo = border.Tag as ChannelInfo;
     //if (ItemTap != null)
     //    ItemTap(sender, channelInfo.VID);
 }
开发者ID:uvbs,项目名称:MyProjects,代码行数:7,代码来源:SmallChannelItem.xaml.cs

示例12: OnControlTap

 private void OnControlTap(object sender, GestureEventArgs e)
 {
     if (AudioState == AudioState.Playing)
         QuranApp.NativeProvider.AudioProvider.Pause();
     else if (AudioState == AudioState.Paused)
         QuranApp.NativeProvider.AudioProvider.Play();
 }
开发者ID:g360230,项目名称:quran-phone,代码行数:7,代码来源:AudioPlayerControl.xaml.cs

示例13: SearchLogo_Tap

 private void SearchLogo_Tap(object sender, GestureEventArgs e)
 {
     if (InputText != null && SearchBox.Text.Length > 0)
     {
         InputText(this, SearchBox.Text);
     }
 }
开发者ID:uvbs,项目名称:MyProjects,代码行数:7,代码来源:SearchBar.xaml.cs

示例14: image_Tap

        private void image_Tap(object sender, GestureEventArgs e)
        {
            Ellipse temp = (Ellipse)sender;
            string txt = temp.Name;
            int x = int.Parse(txt.Substring(5, txt.LastIndexOf("_") - 5));
            int y = int.Parse(txt.Substring(txt.LastIndexOf("_") + 1, txt.Length - txt.LastIndexOf("_") - 1));
            txtStatus.Text = x.ToString() + " " + y.ToString();

            if (gamefield[x, y] == 0)
            {
                if (n % 2 == 0)
                {
                    SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 48, 48, 48));
                    temp.Fill = brush;
                    gamefield[x, y] = 1;
                }
                else
                {
                    SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 220, 220, 220));
                    temp.Fill = brush;
                    gamefield[x, y] = 2;
                }
                n++;
            }
        }
开发者ID:descorp,项目名称:GoWindows,代码行数:25,代码来源:GameField.xaml.cs

示例15: Click

        private void Click(object sender, GestureEventArgs gestureEventArgs)
        {
            object obj = ((FrameworkElement) sender).DataContext;

            DirectoryItem directoryItem = obj as DirectoryItem;
            if (directoryItem != null)
            {
                // Navigate into that directoryitem
                string path = string.Empty;
                if (NavigationContext.QueryString.ContainsKey("Path"))
                    path = NavigationContext.QueryString["Path"] + "/";
                path += (directoryItem).Name;

                NavigationService.Navigate(new Uri("/Wall.xaml?Structure=Folders&Path=" + path, UriKind.Relative));
                return;
            }

            FavList favList = obj as FavList;
            if (favList != null)
            {
                NavigationService.Navigate(new Uri("/Wall.xaml?Structure=Favs&Path=" + favList.Name, UriKind.Relative));
                return;
            }

            Game game = obj as Game;
            if (game == null) return;

            NavigationService.Navigate(new Uri("/GameInfo.xaml?id=" + game.ID, UriKind.Relative));
        }
开发者ID:JQE,项目名称:XK3Y-Remote-Control,代码行数:29,代码来源:Wall.xaml.cs


注:本文中的GestureEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。