private void OnItemInvoked(object sender, RoutedEventArgs e) { if (sender is GooeyButtonItem gooeyButtonItem) { ItemInvoked?.Invoke(this, new GooeyButtonItemInvokedEventArgs(gooeyButtonItem.Content)); } }
private async void FileList_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e) { DismissColumn?.Invoke(sender as ListView, EventArgs.Empty); await Task.Delay(200); if (listViewItem != null) { listViewItem.Style = (Style)this.Resources["NormalStyle"]; } if ((e.OriginalSource as FrameworkElement)?.DataContext is ListedItem && !AppSettings.OpenItemsWithOneclick) { if (listViewItem != null) { listViewItem.Style = (Style)this.Resources["NormalStyle"]; } var item = (e.OriginalSource as FrameworkElement).DataContext as ListedItem; if (item.ItemType == "File folder") { if (item.ContainsFilesOrFolders) { listViewItem = (FileList.ContainerFromItem(item) as ListViewItem); ItemInvoked?.Invoke(new ColumnParam { Path = item.ItemPath, ListView = FileList }, EventArgs.Empty); } } // The delay gives time for the item to be selected else { NavigationHelpers.OpenSelectedItems(ParentShellPageInstance, false); } } }
private void OnMenuItemsHost_ItemClick(object sender, ItemClickEventArgs e) { ItemInvoked?.Invoke( this, CreateInvokedItemParameter(e.ClickedItem) ); }
private void NavigationViewItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args) { var options = OptionsItemsSource as IEnumerable <object>; var isOption = options != null && options.Contains(args.InvokedItem); ItemInvoked?.Invoke(this, new HamburgetMenuItemInvokedEventArgs() { InvokedItem = args.InvokedItem, IsItemOptions = isOption }); }
private void RaiseItemInvoked(NavigationViewItemInvokedEventArgs e) { ItemInvoked?.Invoke( this, e ); if (_rootSplitView != null && DisplayMode != NavigationViewDisplayMode.Expanded) { _rootSplitView.IsPaneOpen = false; } }
private void OnSettingsPressed() { if (SettingsItem is NavigationViewItem item) { ItemInvoked?.Invoke( this, CreateInvokedItemParameter(item) ); SelectedItem = SettingsItem; _menuItemsHost.SelectedItem = null; } }
private void OptionsListView_ItemClick(object sender, ItemClickEventArgs e) { if (_buttonsListView != null) { _buttonsListView.SelectedIndex = -1; } OptionsItemClick?.Invoke(this, e); ItemInvoked?.Invoke(this, new HamburgetMenuItemInvokedEventArgs() { InvokedItem = e.ClickedItem, IsItemOptions = true }); }
private void InvokeItem(object focusedItem) { SetSelectedItem(focusedItem as ListViewItem); ItemInvoked?.Invoke(this, focusedItem as ListViewItem); if (splitViewHost.IsPaneOpen && ( splitViewHost.DisplayMode == SplitViewDisplayMode.CompactOverlay || splitViewHost.DisplayMode == SplitViewDisplayMode.Overlay)) { splitViewHost.IsPaneOpen = false; var item = focusedItem as ListViewItem; item?.Focus(FocusState.Programmatic); } }
private void InvokeItem(object item) { SetSelectedItem(item as ListViewItem); ItemInvoked?.Invoke(this, item as ListViewItem); if (splitView.IsPaneOpen && (splitView.DisplayMode == SplitViewDisplayMode.CompactOverlay || splitView.DisplayMode == SplitViewDisplayMode.Overlay)) { splitView.IsPaneOpen = false; if (item is ListViewItem) { ((ListViewItem)item).Focus(FocusState.Programmatic); } } }
private void InvokeItem(object focusedItem) { SetSelectedItem(focusedItem as ListViewItem); ItemInvoked?.Invoke(this, focusedItem as ListViewItem); if (_splitViewHost.IsPaneOpen && ( _splitViewHost.DisplayMode == SplitViewDisplayMode.CompactOverlay || _splitViewHost.DisplayMode == SplitViewDisplayMode.Overlay)) { _splitViewHost.IsPaneOpen = false; if (focusedItem is ListViewItem) { ((ListViewItem)focusedItem).Focus(FocusState.Programmatic); } } }
private void InvokeItem(object focusedItem) { ListViewItem item = focusedItem as ListViewItem; SetSelectedItem(item); ItemInvoked?.Invoke(this, item); if (!_splitViewHost.IsPaneOpen || (_splitViewHost.DisplayMode != SplitViewDisplayMode.CompactOverlay && _splitViewHost.DisplayMode != SplitViewDisplayMode.Overlay)) { return; } _splitViewHost.IsPaneOpen = false; item?.Focus(FocusState.Programmatic); }
private async void FileList_ItemClick(object sender, ItemClickEventArgs e) { DismissColumn?.Invoke(sender as ListView, EventArgs.Empty); await Task.Delay(200); if (listViewItem != null) { listViewItem.Style = (Style)this.Resources["NormalStyle"]; } var ctrlPressed = Window.Current.CoreWindow.GetKeyState(VirtualKey.Control).HasFlag(CoreVirtualKeyStates.Down); var shiftPressed = Window.Current.CoreWindow.GetKeyState(VirtualKey.Shift).HasFlag(CoreVirtualKeyStates.Down); if (ctrlPressed || shiftPressed) // Allow for Ctrl+Shift selection { return; } if (IsRenamingItem) { return; } var item = (e.ClickedItem as ListedItem); // Check if the setting to open items with a single click is turned on if (AppSettings.OpenItemsWithOneclick) { tapDebounceTimer.Stop(); await Task.Delay(200); if (item.ItemType == "File folder") { if (item.ContainsFilesOrFolders) { listViewItem = (FileList.ContainerFromItem(item) as ListViewItem); ItemInvoked?.Invoke(new ColumnParam { Path = item.ItemPath, ListView = FileList }, EventArgs.Empty); } } // The delay gives time for the item to be selected else { NavigationHelpers.OpenSelectedItems(ParentShellPageInstance, false); } } }
private void OnOptionsItemClick() { if (_buttonsListView != null) { _buttonsListView.SelectedIndex = -1; } var selectedItem = _optionsListView.SelectedItem; (selectedItem as HamburgerMenuItem)?.RaiseCommand(); RaiseOptionsItemCommand(); OptionsItemClick?.Invoke(this, new ItemClickEventArgs(selectedItem)); ItemInvoked?.Invoke(this, new HamburgerMenuItemInvokedEventArgs() { InvokedItem = selectedItem, IsItemOptions = true }); }
private void NavigationViewItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args) { if (args.IsSettingsInvoked && _settingsObject != null) { ItemInvoked?.Invoke(this, new HamburgerMenuItemInvokedEventArgs { InvokedItem = _settingsObject }); } else { var options = OptionsItemsSource as IEnumerable <object>; var isOption = options != null && options.Contains(args.InvokedItem); ItemInvoked?.Invoke(this, new HamburgerMenuItemInvokedEventArgs() { InvokedItem = args.InvokedItem, IsItemOptions = isOption }); } }
private void InvokeItem(object focusedItem) { SetSelectedItem(focusedItem as ListViewItem); ItemInvoked?.Invoke(this, focusedItem as ListViewItem); if (splitView != null && splitView.IsPaneOpen && ( splitView.DisplayMode == SplitViewDisplayMode.CompactOverlay || splitView.DisplayMode == SplitViewDisplayMode.Overlay)) { splitView.IsPaneOpen = false; } ListViewItem listViewItem = focusedItem as ListViewItem; if (listViewItem != null) { listViewItem.Focus(FocusState.Programmatic); } }
private void Timeline_KeyUp(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e) { if (TimelinePanel == null) { return; } switch (e.Key) { case Windows.System.VirtualKey.Down: case Windows.System.VirtualKey.GamepadDPadDown: case Windows.System.VirtualKey.GamepadLeftThumbstickDown: TimelinePanel.TopItemIndex++; e.Handled = true; break; case Windows.System.VirtualKey.Up: case Windows.System.VirtualKey.GamepadDPadUp: case Windows.System.VirtualKey.GamepadLeftThumbstickUp: TimelinePanel.TopItemIndex--; e.Handled = true; break; case Windows.System.VirtualKey.Space: case Windows.System.VirtualKey.Enter: case Windows.System.VirtualKey.GamepadA: var item = TimelinePanel.GetTopItem(); if (item == null || !item.IsActionable) { break; } item.Scale(duration: 200, centerX: (float)item.DesiredSize.Width / 2, centerY: (float)item.DesiredSize.Height / 2, scaleX: 1f, scaleY: 1f).StartAsync(); ElementSoundPlayer.Play(ElementSoundKind.Invoke); ItemInvoked?.Invoke(this, new Controls.TimelineItemInvokedEventArgs() { Item = item }); break; } }
private async void FileList_ItemTapped(object sender, TappedRoutedEventArgs e) { var ctrlPressed = Window.Current.CoreWindow.GetKeyState(VirtualKey.Control).HasFlag(CoreVirtualKeyStates.Down); var shiftPressed = Window.Current.CoreWindow.GetKeyState(VirtualKey.Shift).HasFlag(CoreVirtualKeyStates.Down); var item = (e.OriginalSource as FrameworkElement)?.DataContext as ListedItem; if (ctrlPressed || shiftPressed) // Allow for Ctrl+Shift selection { return; } // Check if the setting to open items with a single click is turned on if (item != null && ((UserSettingsService.FilesAndFoldersSettingsService.OpenFoldersWithOneClick && item.PrimaryItemAttribute == StorageItemTypes.Folder) || (UserSettingsService.FilesAndFoldersSettingsService.OpenFilesWithOneClick && item.PrimaryItemAttribute == StorageItemTypes.File))) { ResetRenameDoubleClick(); if (item.PrimaryItemAttribute == StorageItemTypes.Folder) { DismissColumn?.Invoke(sender as ListView, EventArgs.Empty); listViewItem = FileList.ContainerFromItem(item) as ListViewItem; ItemInvoked?.Invoke(new ColumnParam { Path = item.ItemPath, ListView = FileList }, EventArgs.Empty); } else { NavigationHelpers.OpenSelectedItems(ParentShellPageInstance, false); } } else { var clickedItem = e.OriginalSource as FrameworkElement; if (clickedItem is TextBlock textBlock && textBlock.Name == "ItemName") { CheckRenameDoubleClick(clickedItem.DataContext); }
private void FileList_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e) { var clickedItem = e.OriginalSource as FrameworkElement; if (clickedItem?.DataContext is ListedItem item && ((!UserSettingsService.FilesAndFoldersSettingsService.OpenFilesWithOneClick && item.PrimaryItemAttribute == StorageItemTypes.File) || (!UserSettingsService.FilesAndFoldersSettingsService.OpenFoldersWithOneClick && item.PrimaryItemAttribute == StorageItemTypes.Folder))) { if (item.PrimaryItemAttribute == StorageItemTypes.Folder) { DismissColumn?.Invoke(sender as ListView, EventArgs.Empty); listViewItem = FileList.ContainerFromItem(item) as ListViewItem; ItemInvoked?.Invoke(new ColumnParam { Path = item.ItemPath, ListView = FileList }, EventArgs.Empty); } else { NavigationHelpers.OpenSelectedItems(ParentShellPageInstance, false); } } ResetRenameDoubleClick(); }
private void Raise_ItemInvoked(object item) { ItemInvoked?.Invoke(this, new ItemEventArgs { Item = item }); }
private void Timeline_KeyUp(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e) { if (TimelinePanel == null) { return; } switch (e.Key) { case Windows.System.VirtualKey.Down: case Windows.System.VirtualKey.GamepadDPadDown: case Windows.System.VirtualKey.GamepadLeftThumbstickDown: if (Orientation == Orientation.Vertical) { TimelinePanel.ItemIndex++; e.Handled = true; } break; case Windows.System.VirtualKey.Up: case Windows.System.VirtualKey.GamepadDPadUp: case Windows.System.VirtualKey.GamepadLeftThumbstickUp: if (Orientation == Orientation.Vertical) { TimelinePanel.ItemIndex--; e.Handled = true; } break; case Windows.System.VirtualKey.Left: case Windows.System.VirtualKey.GamepadDPadLeft: case Windows.System.VirtualKey.GamepadLeftThumbstickLeft: if (Orientation == Orientation.Horizontal) { TimelinePanel.ItemIndex--; e.Handled = true; } break; case Windows.System.VirtualKey.Right: case Windows.System.VirtualKey.GamepadDPadRight: case Windows.System.VirtualKey.GamepadLeftThumbstickRight: if (Orientation == Orientation.Horizontal) { TimelinePanel.ItemIndex++; e.Handled = true; } break; case Windows.System.VirtualKey.Space: case Windows.System.VirtualKey.Enter: case Windows.System.VirtualKey.GamepadA: var item = TimelinePanel.GetTopItem(); if (item == null || !item.IsActionable) { break; } item.Scale(duration: 200, centerX: 0.5f, centerY: 0.5f, scaleX: 1f, scaleY: 1f).StartAsync(); ElementSoundPlayer.Play(ElementSoundKind.Invoke); ItemInvoked?.Invoke(this, new Controls.TimelineItemInvokedEventArgs() { Container = item }); break; } }
public void InvokeItem(ListViewItem listViewItem) { var viewModel = ItemContainerGenerator.ItemFromContainer(listViewItem); ItemInvoked?.Invoke(this, viewModel); }
private void OnItemClick(object sender, ItemClickEventArgs args) { var itemInvokedArgs = new TreeViewItemInvokedEventArgs(args.ClickedItem); ItemInvoked?.Invoke(this, itemInvokedArgs); }
private void OnItemInvoked(TreeView sender, TreeViewItemInvokedEventArgs args) { ItemInvoked?.Invoke(this, args); }
/// <summary> /// Raises the <see cref="ItemInvoked"/> event /// </summary> /// <param name="e">Event data for the event.</param> protected virtual void OnItemInvoked(NavigationViewItemEventArgs e) { ItemInvoked?.Invoke(this, e); }