0
我想將圖像直接包含到組合框模板中。Windows phone 8.1組合框樣式圖片
我發現這部分代碼,我相信它是在這裏,我會把它:
<Button x:Name="FlyoutButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" FontWeight="Normal" FlowDirection="{TemplateBinding FlowDirection}" FontSize="{ThemeResource ContentControlFontSize}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left" MinHeight="{ThemeResource ComboBoxItemMinHeightThemeSize}" Padding="6.5,0,0,0" Grid.Row="1">
<ContentPresenter x:Name="ContentPresenter" Margin="0,0.8,0,0" MinHeight="32.5">
<TextBlock x:Name="PlaceholderTextBlock" Margin="0" Style="{StaticResource ComboBoxPlaceholderTextBlockStyle}" Text="{TemplateBinding PlaceholderText}"/>
</ContentPresenter>
</Button>
我不能把一個圖片裏面contentPresenter因爲它說,我只能設置「內容」一次。
如果我做一樣的東西:
<ContentPresenter x:Name="ContentPresenter" Margin="0,0.8,0,0" MinHeight="32.5">
<StackPanel Orientation="Horizontal">
<TextBlock x:Name="PlaceholderTextBlock" Margin="0" Style="{StaticResource ComboBoxPlaceholderTextBlockStyle}" Text="{TemplateBinding PlaceholderText}"/>
<Image Source="ms-appx:///Assets/Arrow.png" />
</StackPanel>
</ContentPresenter>
它的實際工作,但我得到了我的XAML視圖頁面的錯誤:「未檢測到安裝的組件無法解析的TargetName PlaceholderTextlock。」我選擇一個項目後圖像也會消失。
我很感激一些指導。
不完全是我想要的,但它對我有點幫助。我最終得到了我想要的。謝謝。 –
你可以Upvote然後:) – CodeNoob
我做到了,但是:「感謝您的反饋!一旦您獲得了15個聲望,您的選票將改變公開顯示的帖子分數。」 - 堆棧溢出 –