Cancel Selcted Event but invoke the Command

Tuesday, November 10, 2015

The challenge  here is relevant for several scenarios, like validation , hooking, etc. when pressing on a button we can invoke the bind command but ignore the selection event, while doing it in a attach property like this one we can keep the MVVM pattern clean . the command is actually get fired ,but the button stays calm. It is also usable in every other control who let us fire the command on mouse enter like in interactions-trigger but block the other items in the chain. public static class CancelClickAction { public static readonly DependencyProperty OnClickProperty =...
אין תגובות

Attached Property – select all text

Tuesday, October 27, 2015

in TextBox control double clicking on Text should select all inner text? Well isn't? not for case the text itself is a complex one, like real number like : 23.34 In that case , it will select but only the part you on it, at least by default What we need now is activate the TextBoxBase.Selectall function but using WPF tools and supporting MVVM architecture. The simple solution will be Attached Property or Behavior , I think that Behavior should kept for complex problems when we do need a reference per control instance , and here a simple static property should be enough. There for...
אין תגובות