c# - WPF expand content to outside the window -
i want following effect in wpf
the main window looks following when click on friends panel friends list should expanded outside window
and when click on item list have able catch event , handle on main window how achieve in wpf?
i've tried use expander, isn't showing content doesn't fit size of window. it's showing part of content
you can use popup
control , set placementtarget
, placement
depending on button clicked. simple example:
<grid> <grid.rowdefinitions> <rowdefinition></rowdefinition> <rowdefinition></rowdefinition> <rowdefinition></rowdefinition> </grid.rowdefinitions> <popup staysopen="false" width="300" height="200" x:name="mypopup"> <popup.child> <stackpanel background="bisque"></stackpanel> </popup.child> </popup> <button margin="25,25,0,25" horizontalalignment="right" width="100" click="buttonbase_onclick">first</button> <button grid.row="1" margin="25,25,0,25" horizontalalignment="right" width="100" click="buttonbase_onclick">second</button> <button grid.row="2" margin="25,25,0,25" horizontalalignment="right" width="100" click="buttonbase_onclick">third</button> </grid> private void buttonbase_onclick(object sender, routedeventargs e) { mypopup.isopen = false; mypopup.placementtarget = sender uielement; mypopup.placement = placementmode.right; mypopup.allowstransparency = true; mypopup.popupanimation = popupanimation.fade; mypopup.isopen = true; }
Comments
Post a Comment