Exemplo n.º 1
0
        public void Init()
        {
            SearchField.Text = Placeholder;

            var searchFieldFocused = Observable
                                     .FromEventPattern(SearchField, nameof(SearchField.GotFocus))
                                     .Do(_ => SearchField.Text = "")
                                     .Retry()
                                     .Subscribe();

            var searchFieldLostFocus = Observable
                                       .FromEventPattern(SearchField, nameof(SearchField.LostFocus))
                                       .Do(_ => SearchField.Text = Placeholder)
                                       .Retry()
                                       .Subscribe();

            var searchFieldEnterPressed = Observable
                                          .FromEventPattern(SearchField, nameof(SearchField.SelectionChanged))
                                          .Do(_ => DataTable.ItemsSource = db.Records.Where(r => r.Url.Contains(SearchField.Text)))
                                          .Subscribe();

            var creationWinOpening2Clicked = Observable
                                             .FromEventPattern(CreationWinOpening, nameof(CreationWinOpening.MouseDoubleClick))
                                             .Do(_ =>
            {
                var win = new NewRecordWindow();
                win.Show();
            })
                                             .Subscribe();
        }
Exemplo n.º 2
0
        public void addRecordManually()
        {
            int             savesCounter = 0;
            int             loadsCounter = 0;
            MyRecord        c            = new MyRecord();
            NewRecordWindow nrw          = new NewRecordWindow(this, ref savesCounter, ref loadsCounter);

            nrw.Show();
        }
Exemplo n.º 3
0
 private void editButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         int             j         = 0;
         int             value     = Int32.Parse(editRecordTextBox.Text);
         NewRecordWindow newRecord = new NewRecordWindow(logic, ref j, ref j);
         newRecord.editRecord(value, 'E');
     }catch (Exception ex) { }
 }