Exemple #1
0
 private void SettingsButton_Click(object sender, EventArgs e)
 {
     try
     {
         SettingsClick?.Invoke(this, new EventArgs());
     }
     catch (BaseException ex)
     {
         ExceptionDialog.Show(ex);
     }
 }
Exemple #2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate(Resource.Layout.sheetMainMenu, container, false);

            SetupToolbar(view, Resource.String.mainMenu, true);

            _categoryListAdapter = new CategoriesListAdapter(Activity, _source)
            {
                HasStableIds = true
            };

            _categoryList = view.FindViewById <RecyclerView>(Resource.Id.listCategories);
            _categoryList.SetAdapter(_categoryListAdapter);
            _categoryList.HasFixedSize = true;
            _categoryList.SetLayoutManager(new LinearLayoutManager(Activity));

            var selectedCategoryPosition = _currCategoryId == null
                ? 0
                : _source.GetPosition(_currCategoryId) + 1;

            _categoryListAdapter.SelectedPosition = selectedCategoryPosition;
            _categoryListAdapter.NotifyDataSetChanged();

            _categoryListAdapter.CategorySelected += (_, id) =>
            {
                CategoryClick?.Invoke(this, id);
            };

            var backupButton           = view.FindViewById <LinearLayout>(Resource.Id.buttonBackup);
            var manageCategoriesButton = view.FindViewById <LinearLayout>(Resource.Id.buttonManageCategories);
            var settingsButton         = view.FindViewById <LinearLayout>(Resource.Id.buttonSettings);

            backupButton.Click += (_, _) =>
            {
                BackupClick?.Invoke(this, null);
                Dismiss();
            };

            manageCategoriesButton.Click += (_, _) =>
            {
                ManageCategoriesClick?.Invoke(this, null);
                Dismiss();
            };

            settingsButton.Click += (_, _) =>
            {
                SettingsClick?.Invoke(this, null);
                Dismiss();
            };
            return(view);
        }
Exemple #3
0
 private void OnSettingsClick(object sender, RoutedEventArgs e)
 {
     SettingsClick?.Invoke(this, Wrapper);
 }
Exemple #4
0
 private void OnSettingsClick(object sender, EventArgs e)
 {
     SettingsClick?.Invoke(sender, e);
 }
Exemple #5
0
 private void SettingsButtonClick(object sender, RoutedEventArgs e)
 {
     SettingsClick?.Invoke(this, e);
 }