コード例 #1
0
        private void tb_TradeFilter_PreviewKeyDown(object sender, KeyEventArgs e)
        {
            var code = tb_TradeFilter.Text.Trim();

            if (e.Key == Key.Enter && code.Length > 0)
            {
                e.Handled = true;
                tb_TradeFilter.Clear();
                popup_TradeFilter.IsOpen = false;
                var model = TradeMenuManager.Instance.TradeModelList.FirstOrDefault(x => x.Code == code);
                PC_Host.OpenPage(model);
                return;
            }
            if ((e.Key == Key.Up || e.Key == Key.Down) && lb_TradeFilter.Items.Count > 0)
            {
                e.Handled = true;
                lb_TradeFilter.SelectedIndex = 0;
                var first = lb_TradeFilter.ItemContainerGenerator.ContainerFromIndex(0) as UIElement;
                if (first != null)
                {
                    first.Focus();
                }
                return;
            }
        }
コード例 #2
0
        private void lb_TradeFilter_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            tb_TradeFilter.Clear();
            popup_TradeFilter.IsOpen = false;
            var model = (sender as Button).Tag as TradeModel;

            PC_Host.OpenPage(model);
        }
コード例 #3
0
 private void MenuContainer_OpenTradeModel(object sender, MenuContainer.OpenTradeModelEventArgs e)
 {
     PC_Host.OpenPage(e.Model);
     toggle_Menu.IsChecked = false;
 }