c# - Showing a progress dialog when loading a View/UserControl using MVVM: Which events should I use? -


i want show loading dialog while opening view/usercontrol takes while open. know can use loaded event close dialog once ui laid out , shown. doing in sample code shown below.

my question is: there event can use in similar manner open dialog when layout/loading process starts?

i open loading dialog viewmodel opens view/usercontrol, spread out logic. furthermore, since using messaging (from mvvmlight) signal view/usercontrol load result in unclean solution imo. ideas how achieve this?

view:

<i:interaction.triggers>     <i:eventtrigger eventname="loaded">         <i:invokecommandaction command="{binding viewloadedeventhandlercommand}" />     </i:eventtrigger> </i:interaction.triggers> 

viewmodel:

    private icommand viewloadedeventhandlercommand;     public icommand viewloadedeventhandlercommand     {                 {             if (viewloadedeventhandlercommand == null)                 viewloadedeventhandlercommand = new relaycommand(() => debug.writeline("mainview loaded."));             return viewloadedeventhandlercommand;         }     } 


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -