コード例 #1
0
 private void ItemOptionsCommandExecute(ItemCommandParameter parameter)
 {
     if (parameter != null)
     {
         var item = parameter.ItemSource as TranslationItem;
         spListBox.SelectedItem = item;
         OpenMenuOnTarget(parameter.ElementSource, parameter.ItemSource, false);
     }
 }
コード例 #2
0
        private void OnOptionsButtonClick(object sender, RoutedEventArgs e)
        {
            var itemCommandParameter = new ItemCommandParameter
            {
                ItemSource = DataContext,
                ElementSource = OptionsButton,
                Tag = "menu"
            };

            if (OptionsCommand != null && OptionsCommand.CanExecute(itemCommandParameter))
                OptionsCommand.Execute(itemCommandParameter);
        }
コード例 #3
0
        private void OnOptionsButtonClick(object sender, RoutedEventArgs e)
        {
            var itemCommandParameter = new ItemCommandParameter
            {
                ItemSource    = DataContext,
                ElementSource = OptionsButton,
                Tag           = "menu"
            };

            if (OptionsCommand != null && OptionsCommand.CanExecute(itemCommandParameter))
            {
                OptionsCommand.Execute(itemCommandParameter);
            }
        }
コード例 #4
0
        private void OnContentContainerMouseUp(object sender, MouseButtonEventArgs e)
        {
            if(e.ChangedButton != MouseButton.Left)
                return;

            var itemCommandParameter = new ItemCommandParameter
            {
                ItemSource = DataContext,
                ElementSource = ContentContainer,
                Tag = "content"
            };

            if (Command != null && Command.CanExecute(itemCommandParameter))
                Command.Execute(itemCommandParameter);
        }
コード例 #5
0
        private void ItemCommandExecute(ItemCommandParameter parameter)
        {
            if (_menu.IsOpen || _ignoreItemCommand)
            {
                _ignoreItemCommand = false;
                return;
            }

            if (parameter != null)
            {
                var item = parameter.ItemSource as TranslationItem;
                if (item != null && !string.IsNullOrEmpty(item.TextWithOverflow))
                {
                    ReplaceSnapshotSpanText(item.TextWithOverflow);
                }
            }
        }
コード例 #6
0
        private void OnContentContainerMouseUp(object sender, MouseButtonEventArgs e)
        {
            if (e.ChangedButton != MouseButton.Left)
            {
                return;
            }

            var itemCommandParameter = new ItemCommandParameter
            {
                ItemSource    = DataContext,
                ElementSource = ContentContainer,
                Tag           = "content"
            };

            if (Command != null && Command.CanExecute(itemCommandParameter))
            {
                Command.Execute(itemCommandParameter);
            }
        }
コード例 #7
0
 private void ItemOptionsCommandExecute(ItemCommandParameter parameter)
 {
     if (parameter != null)
     {
         var item = parameter.ItemSource as TranslationItem;
         spListBox.SelectedItem = item;
         OpenMenuOnTarget(parameter.ElementSource, parameter.ItemSource, false);
     }
 }
コード例 #8
0
        private void ItemCommandExecute(ItemCommandParameter parameter)
        {
            if (_menu.IsOpen || _ignoreItemCommand)
            {
                _ignoreItemCommand = false;
                return;
            }

            if (parameter != null)
            {
                var item = parameter.ItemSource as TranslationItem;
                if (item != null && !string.IsNullOrEmpty(item.TextWithOverflow))
                    ReplaceSnapshotSpanText(item.TextWithOverflow);
            }
        }