2012-01-24 8 views
0

私はバックエンドからピボットをバインドしています。wp7のバックエンドから制御を取得する

<controls:Pivot Name="MainPivot" Visibility="Collapsed"> 
      <controls:Pivot.Background> 
       <ImageBrush ImageSource="Images/ItemBrowse.png"></ImageBrush> 
      </controls:Pivot.Background> 

      <controls:Pivot.HeaderTemplate> 
       <DataTemplate> 
        <TextBlock FontSize="38" Text="{Binding title}" Foreground="White"/> 
       </DataTemplate> 
      </controls:Pivot.HeaderTemplate> 

      <controls:Pivot.ItemTemplate> 
       <DataTemplate> 
        <ScrollViewer Name="scroll" Margin="-12" Background="LightGray" VerticalScrollBarVisibility="Auto"> 
         <StackPanel> 

          <controls:PivotItem Name="pvtItemPrice" > 

           <StackPanel Orientation="Vertical"> 
            <TextBlock Text="Price" Foreground="Black" FontWeight="Bold" FontSize="28" /> 
            <TextBlock Text="{Binding price}" FontSize="22" Foreground="DarkCyan"/> 
           </StackPanel> 

          </controls:PivotItem> 
          <Border BorderThickness="2" BorderBrush="White" Height="3" Width="470"/> 

          <controls:PivotItem Name="pvtItemDescription" > 


           <StackPanel Orientation="Vertical"> 
            <TextBlock Text="Description" Foreground="Black" FontWeight="Bold" FontSize="28" /> 
            <TextBlock Text="{Binding description}" Foreground="Gray" FontSize="22" Width="460" TextWrapping="Wrap"/> 
           </StackPanel> 
          </controls:PivotItem> 
          <Border BorderThickness="2" BorderBrush="White" Height="3" Width="470"/> 




          <controls:PivotItem Name="pvtItemLocation" > 
           <StackPanel Orientation="Vertical"> 
            <TextBlock Text="Location:" Foreground="Black" Padding="5" FontWeight="Bold" FontSize="28" /> 
            <Grid > 
             <StackPanel> 
              <TextBlock Text="{Binding location}" FontSize="22" Foreground="Brown" Width="460" TextWrapping="Wrap" /> 
              <Button BorderBrush="Transparent" Foreground="Yellow" Name="btnShowMap" Width="370" Content="View in Map" Click="btnShowMap_Click" Height="100"> 
               <Button.Background> 
                <ImageBrush ImageSource="Images/ImgBtns.png" /> 
               </Button.Background> 
              </Button> 
             </StackPanel> 
            </Grid> 
           </StackPanel> 
          </controls:PivotItem> 

         </StackPanel> 
        </ScrollViewer> 
       </DataTemplate> 
      </controls:Pivot.ItemTemplate> 

     </controls:Pivot> 

しかし、私は、ユーザーの値に応じてbtnShowMapを表示または非表示にする必要があります。私のピボットのための XAMLです。しかし、私はバックエンドからコントロールを取得することはできません。とにかく私はこれのための解決策を得ることができますか?

答えて

1

上記のマークアップがページ内にある場合は、Visual StudioがbtnShowMapフィールドを生成しているはずです。このファイルのコードビハインドに移動するだけで見つけることができます。

関連する問題