1

우리는 WCF Ria Service 기반 프로젝트에 MVVM Light Silverlight 프로젝트를 사용하고 있습니다. 몇 가지 연구를 한 후에 RiaInstantFeedbackDataSource와 함께 DevExpress DataGrid를 사용하기로 결정했습니다. GridView의 포커스 행을 ModelView 속성에 바인딩하기 전까지는 모든 것이 훌륭하게 작동합니다. 여기에 우리가 FocusedRow의 유형은 [] 객체입니다 실현 선택한 행 (또는 해당 행의 속성 (예 : Id 열))을 ViewModel의 속성에 바인딩하려면 어떻게해야합니까?

우리는 (실행 편집 명령 후 중단 점)이 코드를 디버깅

<UserControl x:Class="OurProject.Silverlight.Views.Personnel.List" 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
     xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" 
     xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" mc:Ignorable="d" 
     DataContext="{Binding Personnel, Source={StaticResource Locator}}" 
     d:DesignWidth="640" d:DesignHeight="480"> 
<Grid> 
    <Grid.RowDefinitions> 
     <RowDefinition /> 
     <RowDefinition Height="30" /> 
    </Grid.RowDefinitions> 

    <dx:RiaInstantFeedbackDataSource x:Name="DataSource" QueryName="{Binding Path=QueryName}" KeyExpression="{Binding Path=KeyExpression}" 
            DomainContext="{Binding Path=Context}" /> 

    <dxg:GridControl Name="grid" ItemsSource="{Binding ElementName=DataSource, Path=Data}" Grid.Row="0" AutoPopulateColumns="True" > 
     <dxg:GridControl.View> 
      <dxg:TableView x:Name="view" FocusedRow="{Binding Selected}" /> 
     </dxg:GridControl.View> 
    </dxg:GridControl> 
    <Button Grid.Row="1" Height="30" VerticalAlignment="Bottom" Content="Edit" Command="{Binding Edit}" /> 
</Grid> 

우리의 XAML이다. RowPropertyValueConverter를 시도했지만 사용 방법에 대한 문서를 찾을 수 없습니다. 선택한 행 (또는 해당 행의 속성 (예 : Id 열))을 ViewModel의 속성에 바인딩하려면 어떻게해야합니까?

추신 : this link을 확인했지만 RiaInstantDataSource에서는 작동하지 않습니다.

미리 감사드립니다.

답변

1

OK, 우리는 = "참"

AreSourceRowsThreadSafe 우리의 코드

추가이 문제를 해결했다.

<dx:RiaInstantFeedbackDataSource x:Name="DataSource" QueryName="{Binding Path=QueryName}" KeyExpression="{Binding Path=KeyExpression}" AreSourceRowsThreadSafe="True" DomainContext="{Binding Path=Context}" /> 

여기서는 멀티 스레딩에 대한 영향을 추적하고 여기에 중요한 창립을 기록 할 것입니다.

+0

지금까지 영향 없음 ... –