Exemple #1
0
 private void InitHandlers()
 {
     Observable.FromEventPattern <ScrolledEventArgs>(
         h => MainLst.Scrolled += h,
         h => MainLst.Scrolled -= h)
     .Select(x => x.EventArgs)
     .Subscribe(async _ =>
                await Task.Run(() =>
     {
         if (_previousY < _.ScrollY)
         {
             Device.BeginInvokeOnMainThread(() => CreateBtn.Hide());
         }
         else if (_previousY > _.ScrollY)
         {
             Device.BeginInvokeOnMainThread(() => CreateBtn.Show());
         }
         _previousY = _.ScrollY;
     })
                );
     this.WhenAnyValue(x => x.DayPicker.SelectedDate)
     .Where(x => !_action.IsNullOrEmptyOrWhiteSpace() &&
            _action != TranslationCodeExtension.GetTranslation("CancelAction") &&
            x.HasValue)
     .Select(x => x.Value)
     .Subscribe(_ =>
     {
         DayPicker.Date = DateTime.Today;
         ViewModel.AddDayExecute(_, _action);
     });
     CreateBtn.Clicked = async(s, e) => await CreateDayExecute();
 }
        public Form1()
        {
            InitializeComponent();
            SqldataGridView.Hide();
            tableLayoutPanel1.Hide();
            CreateBtn.Hide();
            UpdateBtn.Hide();
            UpdateBtn.Enabled = false;
            DeleteBtn.Hide();
            DeleteBtn.Enabled = false;
            TurnOnEditBth.Hide();
            TurnOffEditBth.Hide();
            SaveBtn.Hide();
            tableLayoutPanel2.Hide();
            tableLayoutPanel3.Hide();

            SqldataGridView.ReadOnly = false;
        }