2014-11-04 2 views

답변

0

새 허브 컨트롤을 사용하지 않았지만 다른 허브 컨트롤과 동일해야합니다. EventToCommand를 사용하여 RelayCommands를 이벤트에 바인딩 할 수 있습니다. http://msdn.microsoft.com/en-us/magazine/dn237302.aspx을 읽으십시오. LoadedCommand 소성 결합이 사용자 제어로드 이벤트를 도시

니펫

<UserControl x:Class="Bill.Views.Setup.AdjustmentReasonsView" 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
     xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
     xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF45" 
     xmlns:igDP="http://infragistics.com/DataPresenter" 
     mc:Ignorable="d" 
     d:DesignHeight="300" d:DesignWidth="300" 
     > 

<i:Interaction.Triggers> 
    <i:EventTrigger EventName="Loaded"> 
     <cmd:EventToCommand Command="{Binding Mode=OneWay, Path=LoadedCommand}" PassEventArgsToCommand="True" /> 
    </i:EventTrigger> 
</i:Interaction.Triggers> 

. . .