This is a migrated thread and some comments may be shown as answers.
not display bus icon when runtime
2 Answers 42 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Park
Top achievements
Rank 1
Park asked on 04 Feb 2012, 03:45 PM
hi

display bus icon when design-time (look at att picture)
but, run time it is not display
what problem?

<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
 xmlns:telerikPrimitives="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Primitives"
    xmlns:telerikDataControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Data"
    xmlns:kaki104_PhoneClassLibrary_Converters="clr-namespace:kaki104.PhoneClassLibrary.Converters;assembly=kaki104.PhoneClassLibrary"
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Core"
    xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
    xmlns:bar="clr-namespace:BindableApplicationBar;assembly=BindableApplicationBar"
    x:Class="BusInfo2.Views.Sub1View"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="728"
    SupportedOrientations="PortraitOrLandscape"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False">

 <phone:PhoneApplicationPage.Resources>
  <kaki104_PhoneClassLibrary_Converters:RouteTypeToNameConverter x:Key="RouteTypeToNameConverter"/>
  <kaki104_PhoneClassLibrary_Converters:StationTpToTextConverter x:Key="StationTpToTextConverter"/>
 </phone:PhoneApplicationPage.Resources>
 <phone:PhoneApplicationPage.FontFamily>
  <StaticResource ResourceKey="KakiPhoneFontFamilyNormal"/>
 </phone:PhoneApplicationPage.FontFamily>
   
    <bar:Bindable.ApplicationBar>
        <bar:BindableApplicationBar >
         <bar:BindableApplicationBar.MenuItems>
          <bar:BindableApplicationBarMenuItem Text="결과목록 삭제" Command="{Binding DeleteCommand, Mode=OneWay}"  />
         </bar:BindableApplicationBar.MenuItems>
            <bar:BindableApplicationBarButton Text="새로고침"
                                              IconUri="/Images/appbar.refresh.rest.png"
                                              IsEnabled="{Binding IsRefresh, Mode=TwoWay, UpdateSourceTrigger=Explicit}"
                                              Command="{Binding RefreshCommand, Mode=OneWay}" />
        </bar:BindableApplicationBar>
    </bar:Bindable.ApplicationBar>
    <!--Panorama-based applications should not show an ApplicationBar-->
 <phone:PhoneApplicationPage.FontSize>
  <StaticResource ResourceKey="PhoneFontSizeNormal"/>
 </phone:PhoneApplicationPage.FontSize>
 <phone:PhoneApplicationPage.Foreground>
  <StaticResource ResourceKey="PhoneForegroundBrush"/>
 </phone:PhoneApplicationPage.Foreground>
 <phone:PhoneApplicationPage.DataContext>
  <Binding Path="Sub1" Source="{StaticResource Locator}"/>
 </phone:PhoneApplicationPage.DataContext>
 <Grid x:Name="LayoutRoot">

  <controls:Pivot x:Name="sub1Pivot" Title="{Binding LocalizedResources.AppMainTitleLable, Source={StaticResource LocalizedStrings}}" FontFamily="{StaticResource KakiPhoneFontFamilyNormal}">
   <i:Interaction.Triggers>
    <i:EventTrigger EventName="SelectionChanged">
     <i:InvokeCommandAction Command="{Binding SelectionChangedCommand, Mode=OneWay}" CommandParameter="{Binding ElementName=sub1Pivot, Mode=OneWay}"/>
    </i:EventTrigger>
    <i:EventTrigger>
     <i:InvokeCommandAction Command="{Binding SelectionChangedCommand, Mode=OneWay}" CommandParameter="{Binding ElementName=sub1Pivot}"/>
    </i:EventTrigger>
   </i:Interaction.Triggers>

   <!--Panorama item one-->
   <controls:PivotItem x:Name="piSearch" Header="검색">
    <Grid>
     <Grid.RowDefinitions>
      <RowDefinition Height="Auto" MinHeight="31"/>
      <RowDefinition Height="Auto" MinHeight="70"/>
      <RowDefinition Height="Auto" MinHeight="41"/>
      <RowDefinition/>
     </Grid.RowDefinitions>
     <StackPanel d:LayoutOverrides="Height">
      <TextBlock Text="통합 검색" Style="{StaticResource KakiPhoneTextLargeStyle}" Margin="21,0,0,21"/>
      <TextBlock TextWrapping="Wrap" Text="노선번호로 검색시 숫자 2 ~ 4 자리를 입력, 정류소번호로 검색시 숫자 5자리만 입력, 정류소명칭 검색시 문자 2자리 이상 입력" Style="{StaticResource KakiPhoneTextMediumStyle}" Margin="21,0,0,21"/>
     </StackPanel>
     <StackPanel Orientation="Horizontal" Grid.Row="1">
      <TextBox TextWrapping="Wrap" Text="{Binding SSearchText, Mode=TwoWay}" Width="382" Height="72" Margin="0,0,0,-2"/>
      <Button Width="72" Height="72">
       <Button.Background>
        <ImageBrush ImageSource="/BusInfo2;component/Images/appbar.feature.search.rest.png" Stretch="None"/>
       </Button.Background>
                           
       <i:Interaction.Triggers>
        <i:EventTrigger EventName="Click">
         <i:InvokeCommandAction Command="{Binding SearchCommand, Mode=OneWay}"/>
        </i:EventTrigger>
       </i:Interaction.Triggers>
                           
      </Button>
     </StackPanel>
     <TextBlock TextWrapping="Wrap" Text="현재 설정된 지역은 서울 입니다." Grid.Row="2" Margin="8,21,0,21" Style="{StaticResource KakiPhoneTextSubtleStyle}"/>
     <telerikPrimitives:RadDataBoundListBox x:Name="lbSearchData" Grid.Row="3" EmptyContent="" ItemTemplate="{StaticResource RecentDataTemplate}" ItemsSource="{Binding SearchDataCollection}">
      <i:Interaction.Triggers>
       <i:EventTrigger EventName="ItemTap">
        <i:InvokeCommandAction Command="{Binding ItemTapCommand, Mode=OneWay}" CommandParameter="{Binding ElementName=lbSearchData}"/>
       </i:EventTrigger>
      </i:Interaction.Triggers>
     </telerikPrimitives:RadDataBoundListBox>
    </Grid>
   </controls:PivotItem>

   <controls:PivotItem x:Name="piBusRouteList" Header="노선번호">
    <Grid>
     <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition />
     </Grid.RowDefinitions>
     <telerikInput:RadListPicker x:Name="lpBusRoute" VerticalAlignment="Stretch" ItemsSource="{Binding SearchBusRouteCollection}"
                                        PopupHeader="노선번호 검색기록" BorderThickness="2" ItemTemplate="{StaticResource RecentDataTemplate}" Style="{StaticResource RadListPickerStyle}">
      <i:Interaction.Triggers>
       <i:EventTrigger EventName="SelectionChanged">
        <i:InvokeCommandAction Command="{Binding SelectionChangedCommand, Mode=OneWay}" CommandParameter="{Binding ElementName=lpBusRoute}"/>
       </i:EventTrigger>
      </i:Interaction.Triggers>
     </telerikInput:RadListPicker>
     <telerikPrimitives:RadDataBoundListBox x:Name="lbBusRoute" ItemsSource="{Binding BusVM.BusRouteCollection}" EmptyContent="검색된 결과가 없습니다." ItemTemplate="{StaticResource BusRouteDataTemplate}" Margin="0,0.5,0,0" Grid.Row="1" ItemContainerStyle="{StaticResource TouchItemContainerStyle1}" CacheMode="BitmapCache">
      <i:Interaction.Triggers>
       <i:EventTrigger EventName="ItemTap">
        <i:InvokeCommandAction Command="{Binding ItemTapCommand, Mode=OneWay}" CommandParameter="{Binding ElementName=lbBusRoute}"/>
       </i:EventTrigger>
      </i:Interaction.Triggers>
     </telerikPrimitives:RadDataBoundListBox>
    </Grid>
   </controls:PivotItem>
   <controls:PivotItem x:Name="piStationPos" Header="정류소&amp;위치">
    <Grid>
     <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition/>
     </Grid.RowDefinitions>

     <telerikInput:RadListPicker x:Name="lpStationPos" VerticalAlignment="Stretch" ItemsSource="{Binding BusVM.BusRouteHistoryCollection}"
                                        PopupHeader="노선번호 검색기록" BorderThickness="2" ItemTemplate="{StaticResource BusRouteDataTemplate}" Style="{StaticResource RadListPickerStyle}">
      <i:Interaction.Triggers>
       <i:EventTrigger EventName="SelectionChanged">
        <i:InvokeCommandAction Command="{Binding SelectionChangedCommand, Mode=OneWay}" CommandParameter="{Binding ElementName=lpStationPos}"/>
       </i:EventTrigger>
      </i:Interaction.Triggers>
     </telerikInput:RadListPicker>

     <telerikPrimitives:RadDataBoundListBox x:Name="lbStationPos" Grid.Row="1" EmptyContent="검색된 결과가 없습니다." ItemsSource="{Binding BusVM.StationBusPosCollection}"
      ItemTemplate="{StaticResource StationPosDataTemplate}">
      <i:Interaction.Triggers>
       <i:EventTrigger EventName="ItemTap">
        <i:InvokeCommandAction Command="{Binding ItemTapCommand, Mode=OneWay}" CommandParameter="{Binding ElementName=lbStationPos}"/>
       </i:EventTrigger>
      </i:Interaction.Triggers>
     </telerikPrimitives:RadDataBoundListBox>
    </Grid>
   </controls:PivotItem>
   <controls:PivotItem x:Name="piStationList" Header="정류소명칭">
    <Grid>
     <Grid.RowDefinitions>
      <RowDefinition Height="Auto" MinHeight="118"/>
      <RowDefinition/>
     </Grid.RowDefinitions>

     <telerikInput:RadListPicker x:Name="lpStationName" VerticalAlignment="Stretch" ItemsSource="{Binding SearchStationNameCollection}"
                                        PopupHeader="정류소명칭 검색기록" BorderThickness="2" ItemTemplate="{StaticResource RecentDataTemplate}" Style="{StaticResource RadListPickerStyle}">
      <i:Interaction.Triggers>
       <i:EventTrigger EventName="SelectionChanged">
        <i:InvokeCommandAction Command="{Binding SelectionChangedCommand, Mode=OneWay}" CommandParameter="{Binding ElementName=lpStationName}"/>
       </i:EventTrigger>
      </i:Interaction.Triggers>
     </telerikInput:RadListPicker>

     <telerikPrimitives:RadDataBoundListBox x:Name="lbStationName" EmptyContent="검색된 결과가 없습니다." ItemsSource="{Binding BusVM.StationNameCollection}" ItemTemplate="{StaticResource StationNameDataTemplate}" Grid.Row="1">
      <i:Interaction.Triggers>
       <i:EventTrigger EventName="ItemTap">
        <i:InvokeCommandAction Command="{Binding ItemTapCommand, Mode=OneWay}" CommandParameter="{Binding ElementName=lbStationName}"/>
       </i:EventTrigger>
      </i:Interaction.Triggers>
     </telerikPrimitives:RadDataBoundListBox>
    </Grid>
   </controls:PivotItem>

   <!--Panorama item two-->
   <controls:PivotItem x:Name="piStationDetail" Header="정류소상세">
    <Grid>
     <Grid.RowDefinitions>
      <RowDefinition Height="Auto" MinHeight="110"/>
      <RowDefinition  />
     </Grid.RowDefinitions>
                   
     <telerikInput:RadListPicker x:Name="lpStationDetail" ItemTemplate="{StaticResource StationDetailHeaderDataTemplate}"
      ItemsSource="{Binding BusVM.StationHistoryCollection}" Style="{StaticResource RadListPickerStyle}"
      PopupHeader="정류소 조회 기록" BorderThickness="2" Height="Auto">
      <i:Interaction.Triggers>
       <i:EventTrigger EventName="SelectionChanged">
        <i:InvokeCommandAction Command="{Binding SelectionChangedCommand, Mode=OneWay}" CommandParameter="{Binding ElementName=lpStationDetail}"/>
       </i:EventTrigger>
      </i:Interaction.Triggers>
     </telerikInput:RadListPicker>
                   
     <telerikPrimitives:RadDataBoundListBox x:Name="lbStationDetail" Grid.Row="1" EmptyContent="검색된 결과가 없습니다."
                                                             ItemsSource="{Binding BusVM.StationNoCollection}" ItemTemplate="{StaticResource StationNoRouteDataTemplate}" >
      <telerikPrimitives:RadContextMenu.ContextMenu>
       <telerikPrimitives:RadContextMenu Opening="RadContextMenu_Opening">
        <telerikPrimitives:RadContextMenuItem Content="즐겨찾기 추가" Command="{Binding AddFavoriteCommand, Mode=OneWay}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}"/>
       </telerikPrimitives:RadContextMenu>
      </telerikPrimitives:RadContextMenu.ContextMenu>
     </telerikPrimitives:RadDataBoundListBox>
    </Grid>
   </controls:PivotItem>
  </controls:Pivot>

       
    </Grid>

</phone:PhoneApplicationPage>



 <!--서브1,노선번호,버스노선 데이터 템플릿-->
 <DataTemplate x:Key="BusRouteDataTemplate">
            <Grid x:Name="TemplateLayoutRoot" MinWidth="430">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="72"/>
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
             <Border Margin="0,0,3,0" Background="{Binding RouteType, Converter={StaticResource RouteTypeToColorConverter}}" Width="72" >
              <Image Source="Images/icon99.png" />
             </Border>
             <StackPanel Grid.Column="1">
              <TextBlock Text="{Binding BusRouteNm}" Style="{StaticResource KakiPhoneTextLargeStyle}"/>
              <Grid >
               <TextBlock Text="{Binding StartStationNm}" Style="{StaticResource KakiPhoneTextSubtleStyle}" HorizontalAlignment="Left"/>
               <TextBlock Text="{Binding EndStationNm}" Style="{StaticResource KakiPhoneTextSubtleStyle}" HorizontalAlignment="Right" />
              </Grid>
             </StackPanel>
            </Grid>
 </DataTemplate>


2 Answers, 1 is accepted

Sort by
0
Park
Top achievements
Rank 1
answered on 07 Feb 2012, 08:02 AM
Troubleshooting

Change the path of the image file to try to resolve the binding

<Image Source="Images/icon99.png" />
to
<Image Source="/BusInfo2;component/Images/icon99.png"/>

The exact reason is unknown
Perhaps the item template at run time in the interior will not find the path to the image equals
0
Iestyn
Top achievements
Rank 1
answered on 12 Apr 2012, 12:44 PM
Hi

sorry I'm a bit late to this but is your image Build action set as content or resource?
Tags
DataBoundListBox
Asked by
Park
Top achievements
Rank 1
Answers by
Park
Top achievements
Rank 1
Iestyn
Top achievements
Rank 1
Share this question
or