Exemplo n.º 1
0
 private void StatusLabel_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout(StatusLabel);
     e.Handled = true;
 }
Exemplo n.º 2
0
 private void MarkSeenMark_Tapped(object sender, TappedRoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout(sender as FrameworkElement);
     e.Handled = true;
 }
Exemplo n.º 3
0
 private void noteItem_Holding(object sender, HoldingRoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout(sender as FrameworkElement);
 }
Exemplo n.º 4
0
        //图片右击
        private void LayerImage_RightTapped(object sender, RightTappedRoutedEventArgs e)
        {
            FlyoutBase.ShowAttachedFlyout((FrameworkElement)sender);

            Jugde();//判断
        }
Exemplo n.º 5
0
 private void Border_Holding(object sender, HoldingRoutedEventArgs e)
 {
     Hover = (FrameworkElement)sender;
     FlyoutBase.ShowAttachedFlyout((FrameworkElement)sender);
 }
Exemplo n.º 6
0
 private void HideSearchResults()
 {
     FlyoutBase.GetAttachedFlyout(_flyoutContainer)?.Hide();
 }
Exemplo n.º 7
0
 public object Execute(object sender, object parameter)
 {
     FlyoutBase.ShowAttachedFlyout((FrameworkElement)sender);
     return(null);
 }
Exemplo n.º 8
0
        /// <summary>
        /// Ajoute un bouton à la barre
        /// </summary>
        /// <param name="objectType">type d'objet à créer</param>
        /// <param name="emplacement">Type d'emplacment du bouton sur la CommandBar, PrimaryCommands ou SecondaryCommands</param>
        /// <param name="icon">Icon du bouton</param>
        /// <param name="label">Label du bouton</param>
        /// <param name="command">ICommand du bouton</param>
        /// <param name="commandParameter">CommandParameter de la ICommand du bouton</param>
        private static CommandBarElement AddObjectToCommandBar(CommandBarButtonType objectType, CommandBarEmplacement emplacement, IconElement icon, string label, ICommand command, object commandParameter, FlyoutBase flyout)
        {
            ICommandBarElement element = null;

            switch (objectType)
            {
                case CommandBarButtonType.Button:
                    element = new AppBarButton
                    {
                        Icon = icon,
                        Label = label,
                        Command = command,
                        CommandParameter = commandParameter
                    };
                    break;
                case CommandBarButtonType.ToggleButton:
                    element = new AppBarToggleButton()
                    {
                        Icon = icon,
                        Label = label,
                        Command = command,
                        CommandParameter = commandParameter
                    };
                    break;
                case CommandBarButtonType.FlyoutButton:
                    element = new AppBarButton()
                    {
                        Icon = icon,
                        Label = label,
                        Flyout = flyout
                    };
                    break;
                case CommandBarButtonType.Separator:
                    element = new AppBarSeparator();
                    break;
            }

            if (element != null)
            {
                if (emplacement == CommandBarEmplacement.Primary)
                {
                    _commandBar.PrimaryCommands.Add(element);
                }
                else
                {
                    _commandBar.SecondaryCommands.Add(element);
                }

                if (_commandBar.Visibility == Visibility.Collapsed)
                {
                    _commandBar.Visibility = Visibility.Visible;
                }
            }
            return new CommandBarElement() { Element = element, Emplacement = emplacement };
        }
Exemplo n.º 9
0
        private void PinCommandBarButton_Click(object sender, RoutedEventArgs e)
        {
            MovableAppBarButton button = (MovableAppBarButton)sender;

            FlyoutBase.ShowAttachedFlyout(button);
        }
Exemplo n.º 10
0
 private void Gfijos_Holding(object sender, RightTappedRoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout((FrameworkElement)sender);
 }
Exemplo n.º 11
0
 private void MonsterTagFlyout_Closing(FlyoutBase sender, FlyoutBaseClosingEventArgs args)
 {
     MonsterLogList.SelectedItem = null;
 }
Exemplo n.º 12
0
 private void pic_Tapped(object sender, TappedRoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout(pic);
 }
 private void PageInfoElement_Tapped(object sender, TappedRoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout((FrameworkElement)sender);
 }
Exemplo n.º 14
0
        private static IEnumerable<DependencyObject> DecomposeFlyout(FlyoutBase flyoutBase) {
            var flyout = flyoutBase as Flyout;

            if (flyout != null && flyout.Content != null)
                yield return flyout.Content;

            var menuFlyout = flyoutBase as MenuFlyout;

            if (menuFlyout != null && menuFlyout.Items != null) {
                foreach (var item in menuFlyout.Items) {
                    yield return item;
                }
            }
        }
Exemplo n.º 15
0
 private void ArticleLink_Holding(object sender, RoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout((FrameworkElement)sender);
 }
Exemplo n.º 16
0
 private void sceneContentEditor_EditComplete()
 {
     if (_flyout != null) {
         _flyout.Hide();
         _flyout = null;
     }
 }
Exemplo n.º 17
0
        private void HeaderLB_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (HeaderLB.SelectedIndex != -1)
            {
                if (toSettings || toWebView)
                {
                    SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = HomePage.Instance.eventopen.Visibility == Visibility.Visible ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed;
                    MainFrame.GoBack();
                    toSettings = false;
                    toWebView  = false;
                }

                if (MainSplitView.IsPaneOpen == true)
                {
                    MainSplitView.IsPaneOpen = false;
                }

                SettingsLB.SelectedIndex = -1;

                if (e.AddedItems[0] == SendNotification)
                {
                    HomePage.Instance.mainframe.Navigate(typeof(SendNotificationPage));
                }
                else if (e.AddedItems[0] == RaffleManager)
                {
                    RaffleList.Items.Clear();

                    MenuFlyoutSubItem futuros = new MenuFlyoutSubItem()
                    {
                        Text = "Futuros"
                    };
                    MenuFlyoutSubItem anteriores = new MenuFlyoutSubItem()
                    {
                        Text = "Anteriores"
                    };

                    foreach (Event _event in EventsPage.Instance.listEvents)
                    {
                        futuros.Items.Add(new MenuFlyoutItem()
                        {
                            Text = _event.Name
                        });
                    }

                    foreach (Event _event in EventsPage.Instance.pastEvents)
                    {
                        MenuFlyoutItem item = new MenuFlyoutItem()
                        {
                            Text = _event.Name
                        };
                        item.Click += (s, ev) =>
                        {
                            HomePage.Instance.mainframe.Navigate(typeof(RaffleManagerPage), _event);
                        };
                        anteriores.Items.Add(item);
                    }

                    RaffleList.Items.Add(futuros);
                    RaffleList.Items.Add(anteriores);

                    FlyoutBase.ShowAttachedFlyout((FrameworkElement)sender);

                    HeaderLB.SelectedIndex = -1;
                }
                else
                {
                    HomePage.Instance.mainframe.Navigate(typeof(EventsPage));
                }
            }
        }
Exemplo n.º 18
0
 private void Source__RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     ((MenuFlyout)FlyoutBase.GetAttachedFlyout((FrameworkElement)sender)).ShowAt(sender as UIElement, e.GetPosition(sender as UIElement));
 }
Exemplo n.º 19
0
 private void SongItemWrapper_Holding(object sender, HoldingRoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout((FrameworkElement)sender);
 }
Exemplo n.º 20
0
 private void ShowSearchResults()
 {
     FlyoutBase.ShowAttachedFlyout(_flyoutContainer);
     _searchBox.Opacity = 0;
 }
Exemplo n.º 21
0
        private void NonterminalInputer_KeyDown(object sender, KeyRoutedEventArgs e)
        {
            TextBox nonterminal = (TextBox)sender;

            if (e.Key == Windows.System.VirtualKey.Enter &&
                !string.IsNullOrEmpty(nonterminal.Text))
            {
                // ε represents epsilon token, but the user does not
                // need to add it by himself
                if (nonterminal.Text.Contains('ε'))
                {
                    nonterminal.Text = "";
                    if (sender is FrameworkElement illegalInput)
                    {
                        FlyoutBase.ShowAttachedFlyout(illegalInput);
                    }
                }
                else
                {
                    try
                    {
                        Terminals.First(elem => elem.Token == nonterminal.Text);
                        // typed nonterminal is same as one existed terminal
                        if (sender is FrameworkElement illegalInput)
                        {
                            FlyoutBase.ShowAttachedFlyout(illegalInput);
                        }
                    }
                    catch (Exception)
                    {
                        try
                        {
                            Nonterminals.First(elem => elem.Token == nonterminal.Text);
                            // duplicated nontermianl
                        }
                        catch (Exception)
                        {
                            // accepted nonterminal
                            Nonterminals.Add(new TokenViewer
                            {
                                Token   = nonterminal.Text,
                                IsStart = false,
                                Type    = TokenType.Nonterminal
                            });
                        }
                    }
                    finally
                    {
                        nonterminal.Text = "";
                    }
                }
            }
            else if (nonterminal.Text.Length == 4)
            {
                e.Handled = true;
            }
            else if (e.Key == Windows.System.VirtualKey.Space)
            {
                e.Handled = true;
            }
            else if (e.Key == Windows.System.VirtualKey.Tab)
            {
                e.Handled = true;
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// Called when applying the control template.
        /// </summary>
        protected override void OnApplyTemplate()
        {
            IsLoading = false;

            if (_flyoutContainer != null)
            {
                var flyout = FlyoutBase.GetAttachedFlyout(_flyoutContainer);
                if (flyout != null)
                {
                    flyout.Closed -= Flyout_Closed;
                }
            }

            if (_searchBox != null)
            {
                _searchBox.SizeChanged -= SearchBox_OnSizeChanged;
                _searchBox.GotFocus    -= SearchBox_GotFocus;
            }

            if (_internalSearchBox != null)
            {
                _internalSearchBox.GotFocus -= SearchBox_GotFocus;
            }

            if (_searchResultListBox != null)
            {
                _searchResultListBox.Tapped -= SearchResultListBox_Tapped;
                _searchResultListBox.KeyUp  -= SearchResultListBox_KeyUp;
            }

            if (_selectionsListBox != null)
            {
                _selectionsListBox.Tapped -= SelectionsListBox_Tapped;
                if (_isPreviewKeyUpEventSupported)
                {
                    _selectionsListBox.PreviewKeyUp -= SelectionsListBox_KeyUp;
                }
            }

            _searchBox           = GetTemplateChild(SearchBoxPartName) as TextBox;
            _internalSearchBox   = GetTemplateChild(InternalSearchBoxTextBoxPartName) as TextBox;
            _searchResultListBox = GetTemplateChild(SearchResultListBoxPartName) as ListBox;
            _selectionsListBox   = GetTemplateChild(SelectionsListBoxPartName) as ListBox;
            _flyoutContainer     = GetTemplateChild(FlyoutContainerPartName) as FrameworkElement;

            if (_flyoutContainer != null)
            {
                var flyout = FlyoutBase.GetAttachedFlyout(_flyoutContainer);
                if (flyout != null)
                {
                    flyout.Closed += Flyout_Closed;
                }
            }

            if (_searchBox != null)
            {
                _searchBox.SizeChanged += SearchBox_OnSizeChanged;
                _searchBox.GotFocus    += SearchBox_GotFocus;
            }

            if (_internalSearchBox != null)
            {
                _internalSearchBox.GotFocus += SearchBox_GotFocus;
            }

            if (_searchResultListBox != null)
            {
                _searchResultListBox.Tapped += SearchResultListBox_Tapped;
                _searchResultListBox.KeyUp  += SearchResultListBox_KeyUp;
            }

            if (_selectionsListBox != null)
            {
                _selectionsListBox.Tapped += SelectionsListBox_Tapped;
                if (_isPreviewKeyUpEventSupported)
                {
                    _selectionsListBox.PreviewKeyUp += SelectionsListBox_KeyUp;
                }
            }

            base.OnApplyTemplate();
        }
Exemplo n.º 23
0
 private void ShowFlyoutClick(object sender, RoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout(FlyoutPanel);
 }
Exemplo n.º 24
0
 private void noteItem_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout(sender as FrameworkElement);
 }
Exemplo n.º 25
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout((FrameworkElement)sender);
 }
Exemplo n.º 26
0
 private void SetDeviceSelectionFlyout()
 {
     FlyoutBase.SetAttachedFlyout(this.scanButton, deviceSelectionFlyout);
     FlyoutBase.ShowAttachedFlyout(this.scanButton);
 }
Exemplo n.º 27
0
 private void NameLabel_Tapped(object sender, TappedRoutedEventArgs e)
 {
     Editor.HSBColorSource = null;
     Editor.HSBColorSource = HSBColorSource;
     FlyoutBase.ShowAttachedFlyout((FrameworkElement)sender);
 }
Exemplo n.º 28
0
 private void YearLabel_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout(YearFiltersMenuTextBlock);
     e.Handled = true;
 }
Exemplo n.º 29
0
 private void ChangeCinemaButton_OnClick(object sender, RoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout(ChangeCinemaButton);
 }
Exemplo n.º 30
0
 private void Tools_Click(object sender, RoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout(this);
 }
 private void buttonFilter_Click(object sender, RoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout(buttonFilter);
 }
Exemplo n.º 32
0
 private void libraryItemRenderer_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     _flyout = FlyoutBase.GetAttachedFlyout((sender as FrameworkElement));
     _flyout.Placement = FlyoutPlacementMode.Right;
     _flyout.ShowAt((sender as FrameworkElement));
 }
Exemplo n.º 33
0
 private void WeaponButton_Tapped(object sender, TappedRoutedEventArgs e)
 {
     FlyoutBase.ShowAttachedFlyout(sender as FrameworkElement);
     //selectedVehicle = VehicleMap.Children.IndexOf((sender as PlanningViewVehicleVM).CCImg);
 }
Exemplo n.º 34
0
 private void editFlyout_Closed(object sender, object e)
 {
     _flyout = null;
 }
Exemplo n.º 35
0
        /// <summary>
        /// Handles right taps on the listview
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ListView_RightTapped(object sender, RightTappedRoutedEventArgs e)
        {
            FlyoutBase.ShowAttachedFlyout(sender as FrameworkElement);

            SelectedIndex = AttachedFilesListView.SelectedIndex;
        }
Exemplo n.º 36
0
 /// <summary>
 /// Ajoute un bouton avec un flyout associé à la CommandBar
 /// </summary>
 /// <param name="emplacement">Type d'emplacment du bouton sur la CommandBar, PrimaryCommands ou SecondaryCommands</param>
 /// <param name="icon">Icon du bouton</param>
 /// <param name="label">Label du bouton</param>
 /// <param name="flyout">Flyout associé au bouton</param>
 public static CommandBarElement AddFlyoutButton(CommandBarEmplacement emplacement, IconElement icon, string label, FlyoutBase flyout)
 {
     return AddObjectToCommandBar(CommandBarButtonType.FlyoutButton, emplacement, icon, label, null, null, flyout);
 }
 public FlyoutBaseEvents(FlyoutBase This)
 {
     this.This = This;
 }