c# - How to Press a button in the view using ViewModel -
i new wpf , understand viewmodel doesn't have communication view. trying follow mvvm pattern in application , press button in view using viewmodel. eg: after successful login want show specific grid in view. can done pressing 'x' button'. when 'x' button has focus show following grid.
..<grid.style> <style targettype="grid"> <style.triggers> <datatrigger binding="{binding isfocused, elementname=x}" value="false"> <setter property="visibility" value="collapsed"/> </datatrigger> <style.triggers> </style> </grid.style>.. given situation, how can grid displayed using viewmodel?
any appreciated.
you 'press' button executing command bound button (a command of icommand type). not give visual indication button pressed have same effect in background. bound property isfocused property of grid toggle visibility via changing property in viewmodel.
Comments
Post a Comment