wpf Load

第一种写法,写在Interaction.Triggers

<UserControl>

 <b:Interaction.Triggers>
        <b:EventTrigger EventName="Loaded">
            <b:CallMethodAction TargetObject="{Binding}"
                                MethodName="Load" />
        </b:EventTrigger>
    </b:Interaction.Triggers>

</UserControl>

 

第二种写法,直接写在UserControl的Loaded事件中

<UserControl x:Class="ChuckReviewView"
             xmlns:viewmodels="Chuck.ViewModels"
             d:DataContext="{d:DesignInstance Type=viewmodels:ChuckReviewViewModel}"
             mc:Ignorable="d"
             Loaded="{DXEvent Handler='Load()', CatchExceptions=False}">
</UserControl>

 

 

 

IsBusy的加载圈

<dx:LoadingDecorator IsSplashScreenShown="{Binding IsBusy}">

 

posted @ 2022-09-01 17:56  ChuckLu  阅读(274)  评论(0)    收藏  举报