本文整理汇总了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();
}
}
示例2: LayoutRootTap
private void LayoutRootTap(object sender, GestureEventArgs e)
{
if (TapAvatar != null)
{
TapAvatar(tbUserName.Text);
}
}
示例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();
}
}
示例4: OnTap
private void OnTap(object sender, GestureEventArgs e)
{
if (Command == null)
return;
Command.Execute(CommandParameter);
}
示例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);
}
示例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);
}
}
}
示例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));
}
示例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);
}
}
示例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
}
}
示例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();
}
示例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);
}
示例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();
}
示例13: SearchLogo_Tap
private void SearchLogo_Tap(object sender, GestureEventArgs e)
{
if (InputText != null && SearchBox.Text.Length > 0)
{
InputText(this, SearchBox.Text);
}
}
示例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++;
}
}
示例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));
}