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();
 }
Exemple #5
0
 private void SearchcomboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (SearchcomboBox.Text == SearchByCategory.CURRENT_STATUS.ToString())
     {
         SearchTb.Hide();
         ApplicantStatusComboBox.Show();
     }
     else
     {
         SearchTb.Show();
         ApplicantStatusComboBox.Hide();
     }
 }
        private void SearchTb_LostFocus(object sender, RoutedEventArgs e)
        {
            DoubleAnimation animation1 = new DoubleAnimation {
                To = 0, Duration = TimeSpan.FromMilliseconds(150)
            };

            animation1.Completed += (s, ar) =>
            {
                DoubleAnimation animation2 = new DoubleAnimation {
                    To = 50, Duration = TimeSpan.FromMilliseconds(100)
                };
                TitleNewsTb.BeginAnimation(HeightProperty, animation2);
            };
            SearchTb.BeginAnimation(HeightProperty, animation1);
            SearchTb.Text = string.Empty;
            timer.Start();
        }