|
17 / 16 / 1
Регистрация: 15.07.2021
Сообщений: 20
|
||||||||||||||||
WPF Focusable Button vs UpdateSourceTrigger15.07.2021, 17:55. Показов 6436. Ответов 21
Hello!
I'm new to this forum, sorry for writing in English and not in Russian and I hope I can correctly explain my question. I have a typical business app, where users can save a transaction to the DB and it is written in C# WPF + MVVM (my property changed implementation is open source and on nuget) there is an amount field in the view among other fields
The problem is that if the user changes the amount and immediately tries to save by clicking the button while the focus is still in the TextBox, the change of the amount is lost. I have initially fixed by setting UpdateSourceTrigger as PropertyChanged, then I've had an usability issue with the double field Amount (it becomes awkward to type a decimal separator) that I've solved by replacing TextBox with the Extended WPF Toolbar DoubleUpDown control. This morning I've noticed that I could have followed a different approach (now I think better and simpler) by fixing the initial issue (immediate click on Save button while typing the amount) not by adding UpdateSourceTrigger but by deleting the Focusable = "False" from the button. I believe that the latter is a good solution. The fact is that the real requirement is not to raise a notification while the user is typing a double, that would not make sense since the number is not even fully typed. The real requirement is to consider the click of the button as lost focus event. Setting the button as focusable (i.e the standard, nothing special to do) simply achieves this goal. What do you think about it? Does it make sense? Thank you in advance for your opinions!
1
|
||||||||||||||||
| 15.07.2021, 17:55 | |
|
Ответы с готовыми решениями:
21
MVVM в Silverlight. UpdateSourceTrigger PropertyChanged
Не работает UpdateSourceTrigger=OnPropertyChanged у TextBox с привязкой к DependencyProperty |
|
Модератор
|
||
| 22.07.2021, 12:17 | ||
|
Are allowed, topics without specific questions, containing just general reasoning, just conversations. Unfortunately, there are significantly fewer users here. In the WPF section, about 90% of the answers are mine. And in English, probably, no one will answer you except me.
1
|
||
|
17 / 16 / 1
Регистрация: 15.07.2021
Сообщений: 20
|
|
| 22.07.2021, 12:27 [ТС] | |
|
Thank you! It's very kind of you.
I have decided that I don't want to open stackoverflow pages , not even to read any answer from there, from now on. Well, I studied some Russian but without the effort required for such a difficult language. Maybe one day I'll return to Russian lessons (atm honestly l lost contact with my teacher... But in the future who knows, things can change...) and maybe you will see me writing in Russian here
1
|
|
| 22.07.2021, 12:27 | |
|
Если Button 1 и Button 2 нажаты - Button 3 стала активной, как? Как бы при загрузки формы вызвать метод UpdateSourceTrigger.PropertyChanged для валидации FlatAppearance у Button только для чтения, как присвоить новой Button FlatAppearance уже существующей Button Как добавить кнопки (if (GUI.Button(new Rect(x1, y1, dx, dy), ii.name) в список List<Button>?
Искать еще темы с ответами Или воспользуйтесь поиском по форуму: |
|
Новые блоги и статьи
|
|||
|
Беседа с ИИ о программистах, недопускающих к созданию и правке кода генеративные ИИ и причины этого
zorxor 21.09.2026
Раньше я радовался или получал некоторые эмоции, пусть небольшие, но всё же, от самого процесса написания кода, рекомпиляции и запуска, видя постепенное развитие программы и прочее. А теперь лень. . .
|
Мобильное приложение ColorStep
pavlinmavlin 17.09.2026
Реализовал приложение Красный, Зеленый, Синий в Unity3d + c#.
Название изменил на ColorStep.
Приложение прошло модерацию и теперь доступно для скачивания. Делал его сам, шаг за шагом — и вот,. . .
|
Запрет дублирования строк в табличной части
Maks 13.09.2026
Реализация из решения ниже выполнена на нетиповом справочнике "Нормы ТО" с табличной часть "Виды ТО", разработанного в КА2, со следующими реквизитами:
- ВидТО (СправочникСсылка. ВидыТО);
- ВидГСМ. . .
|
Скрипты Tampermonkey для CyberForum, ChatGPT, Claude и пр.
Jin X 06.09.2026
Скрипты Tampermonkey для CyberForum, ChatGPT, Claude и пр.
Работая с форумом и нейросетями в браузере часто хочется что-то подкорректировать или добавить какого-то функционала.
Ниже прикреплён. . .
|
|
Программа опроса у.з. расходомера SLS-720F
Argus19 02.09.2026
Программа опроса у. з. расходомера SLS-720F
Программа опрашивает один раз в минуту три ультразвуковых расходомера SLS-720F через интерфейс RS-485 по протоколу Modbus RTU.
Опрашиваются регистры. . .
|
Hyper-V: Компьютер должен поддерживать доверенный платформенный модуль 2.0.
Maks 31.08.2026
При установке Windows 11 на виртуальную машину Hyper-V 2-го поколения вылезла такая ошибка:
Решение: в параметрах виртуальной машины, в разделе "Безопасность" (Security) активировать флаг. . .
|
Архитектура биовида Стива в Майнкрафте: Зачем бонобо кубический каннибализм
anaschu 30.08.2026
Кубический Вагинокапитализм в Minecraft: Математический инвариант ОДУ и рок Стивов-бонобо
Главная задача разработанной «Модели Всего» — наглядно продемонстрировать наличие системной «судьбы». . .
|
Оттачиваю умение писать js программы.
russiannick 30.08.2026
Проектом выходного дня стало написание Книги шифров Виженера. Итогом стала версия 200, синий туман.
Синий туман назван так, потому что замораживает текст под собой. Нажатие синих кнопок управляют. . .
|