c# - Popup with Caliburn Micro in Windows Phone -
could explain how use xaml popups caliburn micro.
thanks
edit:(made code more releavent want achieve) when define popup in xaml this:
<button x:name="showpopup" content="popup"/> <popup x:name="my_popup_xaml" grid.row="2"> <border borderthickness="2" margin="10" borderbrush="green"> <stackpanel background="lightblue"> <textblock text="select option" fontsize="21" margin="10,0" /> <stackpanel orientation="horizontal" margin="0,10"> <button x:name="selectphoto" content="select photo library" width="215"/> <button x:name="capturephoto" content="use camera" width="215"/> </stackpanel> </stackpanel> </border> </popup>
how display popup using windowmanager?
should create new view model because need use photochooser task , camera capture task here?
how bind popup view model.
edit:
@charleh, suggestion using windowmanager separate viewmodel worked, minor tweak.
i removed <popup>
tag , used window manager display popup.
but cannot close popup , popup cropped it's displayed @ top of screen. how fix this?
edit: able close dialog using the screen's tryclose()
method.
when used showdialog
method instead of showpopup
method , alignment of window bit better still stuck @ top , wont align in center.
edit: have created new phoneapplicationpage(windows phone 8 equivalent of window) , displayed dialog. problem approach phoneapplicationpage not stretching automatically fill screen space(which when not displayed dialog). it's stretching accommodate content inside it. setting `verticalalignment="stretch" has no effect.
giving height
property particular value not suitable because of not adjust different phone resolutions.
@charleh tried specifying height , width this:
dictionary<string, object> properies = new dictionary<string, object>(); properies.add("height", 768); properies.add("width", 480); windowmanager.showdialog(new imageselectorpopupviewmodel(),null,properies);
this code has no effect (although specifying height in xaml works cannot use have accommodate different screen resolutions on phone)
you need read on caliburn micro before post - there literally tons of articles showing how bind commands on view methods on vm
to in case either:
bind using convention giving button same name method
<button x:name="showpopup" />
bind using action message syntax:
<button cal:message.attach="[showpopup]" />
all answers here: http://caliburnmicro.codeplex.com/documentation
(specifically: http://caliburnmicro.codeplex.com/wikipage?title=all%20about%20actions&referringtitle=documentation)
you same thing button, can same thing popup
(have considered using caliburns windowmanager has showpopup method?)
edit:
on re-reading looks want use same viewmodel current view , popup - case or want new viewmodel popup? i'd suggest using windowmanager, , creating viewmodel popup - more in-line cm does
Comments
Post a Comment