2017-01-16 4 views
0

どうすればオブジェクトイメージとオブジェクトイメージを呼び出せないのですかbackClickArrow nextClickArrow codebehindから?これらはコントロールの内側にあるのでできません。 コードビハインドからどのように呼び出すことができますか?イベントを開始する必要がありますか?どうもありがとうございます。コードビハインドのコントロール内のオブジェクトを呼び出すXamarinフォーム

<control:CarouselView x:Name="carouselView"> 
      <control:CarouselView.ItemTemplate> 
       <DataTemplate> 
       <Grid Padding="10"> 
        <Grid.ColumnDefinitions> 
        <ColumnDefinition Width="*"></ColumnDefinition> 
        </Grid.ColumnDefinitions> 
        <Grid.RowDefinitions> 
        <RowDefinition Height="40*"></RowDefinition> 
        <RowDefinition Height="0.2*"></RowDefinition> 
        <RowDefinition Height="59.8*"></RowDefinition> 
        </Grid.RowDefinitions> 
        <Grid Grid.Row="0"> 
        <Grid.ColumnDefinitions> 
         <ColumnDefinition Width="5*"></ColumnDefinition> 
         <ColumnDefinition Width="40*"></ColumnDefinition> 
         <ColumnDefinition Width="50*"></ColumnDefinition> 
         <ColumnDefinition Width="5*"></ColumnDefinition> 
        </Grid.ColumnDefinitions> 
        <Grid.RowDefinitions> 
         <RowDefinition Height="*"></RowDefinition> 
        </Grid.RowDefinitions> 
        <Image Source="backBlueArrow.png" x:Name="backClickArrow" Aspect="AspectFit" Grid.Column="0"></Image> 
        <StackLayout Margin="0,0,10,0" VerticalOptions="Center" HorizontalOptions="End" Grid.Column="1"> 
         <Image HeightRequest="70" Source="clock.png" Aspect="AspectFit"></Image> 
        </StackLayout> 
        <Grid Grid.Row="0" Grid.Column="2"> 
         <Grid.ColumnDefinitions> 
         <ColumnDefinition Width="*"></ColumnDefinition> 
         </Grid.ColumnDefinitions> 
         <Grid.RowDefinitions> 
         <RowDefinition Height="40*"></RowDefinition> 
         <RowDefinition Height="60*"></RowDefinition> 
         </Grid.RowDefinitions> 
         <Label Text="Superficie totale" TextColor="#fff" FontSize="Small" VerticalTextAlignment="End" HorizontalTextAlignment="Start" Grid.Row="0"/> 
         <Label Text="890000m2" FontSize="Large" TextColor="#fff" VerticalTextAlignment="Start" HorizontalTextAlignment="Start" Grid.Row="1"/> 
        </Grid> 
        <Image Source="nextBlueArrow.png" x:Name="nextClickArrow" Aspect="AspectFit" Grid.Column="3"></Image> 
        </Grid> 
        <!-- griglia fare la riga bianca --> 
        <Grid Padding="0" BackgroundColor="White" Grid.Row="1"> 
        <Grid.ColumnDefinitions> 
         <ColumnDefinition Width="*"></ColumnDefinition> 
        </Grid.ColumnDefinitions> 
        <Grid.RowDefinitions> 
         <RowDefinition Height="*"></RowDefinition> 
        </Grid.RowDefinitions> 
        </Grid> 
        <Grid Padding="10" Grid.Row="2"> 
        <Grid.ColumnDefinitions> 
         <ColumnDefinition Width="*"></ColumnDefinition> 
        </Grid.ColumnDefinitions> 
        <Grid.RowDefinitions> 
         <RowDefinition Height="*"></RowDefinition> 
        </Grid.RowDefinitions> 
        </Grid> 

       </Grid> 
     <!--<Label Text="{Binding Testo}" />--> 
     </DataTemplate> 
     </control:CarouselView.ItemTemplate> 
     </control:CarouselView> 

私が呼び出したいオブジェクト:

<Image Source="backBlueArrow.png" x:Name="backClickArrow" Aspect="AspectFit" Grid.Column="0"></Image> 

<Image Source="nextBlueArrow.png" x:Name="nextClickArrow" Aspect="AspectFit" Grid.Column="3"></Image> 

答えて

0

を私はこのような解決した:

<Button Image="nextBlueArrow.png" Clicked="clickme" Grid.Column="3"></Button> 

使用ボタンや画像の属性を追加します。

関連する問題