私は1つのリストピッカーを持っているという点で、ユーザーコントロールを持っています。コードは:
<Grid x:Name="LayoutRoot" Background="{StaticResource PhoneChromeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<toolkit:ListPicker x:Name="lstPicker" Grid.Row="1" Margin="25,0,25,15" />
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" >
<Button Width="200" x:Name="btnReAssign" Content="reassign" Margin="5"/>
<Button Width="200" x:Name="btnCancel" Content="cancel" Margin="5"/>
</StackPanel>
</Grid>
今、実行時にポップアップ ユーザー コントロールを作成しています。
MyTaskPopupWindow myTaskPopUpWindow = new MyTaskPopupWindow();
これにはリスト ピッカーが含まれます。今、私はこのリストピッカーを私のデータオブジェクトにバインドしています。
myTaskPopUpWindow.lstPicker.ItemsSource = GetRegisterUserOC;
クラス名はプロパティではなくリストピッカーに表示されます。プロパティの 1 つをこのリスト ピッカーにバインドする方法がわかりません。ユーザー コントロールを変更したくないので、コード ビハインドからプロパティの 1 つをバインドできますか。