c# - Show/Don't Show Remove Button for Edit/New Page -
this pretty simple. have uwp application has page save button , edit button (call page1). page buttons take (page2) same, except when user clicks edit, page2 has remove button , when user clicks save, page2 not have remove button.
i sending parameter page2 in savebtn_click , editbtn_click methods:
frame.navigate(typeof(page2), param1);
and figured send true/false depending on button clicked. since 2 parameters, thought create payload class these values assigned member variables , send payload object (payload). then, in onnavigatedto method of page2's code behind, can set variable (visible) value of payload.visible , set button's visibility property value.
however, thinking there has more elegant way this. in advance.
i think solution there someways that. common way using onnabigatedto , onnabigatedfrom send parameters. if using mvvm can use messages or payloads between viewmodels. way using static class save variables. in case think solution fine
Comments
Post a Comment