private void SearchBtn_Click(object sender, RoutedEventArgs e)
 {
     if (!IsSearchBarOpen)
     {
         DoubleAnimation animation1 = new DoubleAnimation {
             To = 0, Duration = TimeSpan.FromMilliseconds(150)
         };
         animation1.Completed += (s, ar) =>
         {
             DoubleAnimation animation2 = new DoubleAnimation {
                 To = 60, Duration = TimeSpan.FromMilliseconds(100)
             };
             SearchTb.BeginAnimation(HeightProperty, animation2);
             SearchTb.Focus();
         };
         TitleNewsTb.BeginAnimation(HeightProperty, animation1);
         IsSearchBarOpen = true;
     }
     else
     {
         DoubleAnimation animation1 = new DoubleAnimation {
             To = 0, Duration = TimeSpan.FromMilliseconds(150)
         };
         animation1.Completed += (s, ar) =>
         {
             DoubleAnimation animation2 = new DoubleAnimation {
                 To = 60, Duration = TimeSpan.FromMilliseconds(100)
             };
             TitleNewsTb.BeginAnimation(HeightProperty, animation2);
         };
         SearchTb.BeginAnimation(HeightProperty, animation1);
         IsSearchBarOpen = false;
     }
 }
        public StockUnitSearchView()
        {
            InitializeComponent();
            SetActions();

            SearchTb.Focus();
        }
        public StockUnitSearchView(Card card)
        {
            InitializeComponent();

            ViewModel   = new StockUnitSearchViewModel(card);
            DataContext = ViewModel;
            SetActions();

            SearchTb.Focus();
        }
Exemple #4
0
 private void NewBtn_Click(object sender, EventArgs e)
 {
     if (dataGridView1.Rows.Count > 0)
     {
         return;
     }
     GetTransNo();
     SearchTb.Enabled = true;
     SearchTb.Focus();
 }