zoukankan      html  css  js  c++  java
  • WP7 Toolkit AutoCompleteBox 在 Pivot and Panorama无法正常显示的解决方案

    在官方Issue Tracker 有人提出这个BUG

    http://silverlight.codeplex.com/workitem/7574

    主要说了牛人 Jeff Wilcox 提供了解决方案

    http://www.jeff.wilcox.name/2011/03/acb-in-pivot/

    最好下载:根据代码最好理解了

    [ZIP] 31 KB – AutoCompletePivot.zip

    http://www.jeff.wilcox.name/wp-content/uploads/2011/03/AutoCompletePivot.zip

     

    代码很多就不仔细说了;

    复制Converters/VisibilityConverter.cs 到你的工程

    然后 在xaml 里  OK 搞定!~

    <Grid.Resources>
        <localControls:VisibilityConverter x:Key="Vis"/>
    </Grid.Resources>

     

    <ControlTemplate TargetType="toolkit:AutoCompleteBox">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <TextBox
                x:Name="Text"
                Background="{TemplateBinding Background}"
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}"
                FontFamily="{TemplateBinding FontFamily}"
                FontSize="{TemplateBinding FontSize}"
                FontStyle="{TemplateBinding FontStyle}"
                FontWeight="{TemplateBinding FontWeight}"
                Foreground="{TemplateBinding Foreground}"
                InputScope="{TemplateBinding InputScope}"
                Opacity="{TemplateBinding Opacity}"
                Padding="{TemplateBinding Padding}"
                Style="{TemplateBinding TextBoxStyle}"/>
            <ListBox
                Margin="12"
                Visibility="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource Vis}}"
                Grid.Row="1"
                x:Name="Selector"
                Background="White"
                FontFamily="{TemplateBinding FontFamily}"
                FontSize="{TemplateBinding FontSize}"
                FontStyle="{TemplateBinding FontStyle}"
                FontWeight="{TemplateBinding FontWeight}"
                Foreground="{TemplateBinding Foreground}"
                IsTabStop="False"
                ItemContainerStyle="{TemplateBinding ItemContainerStyle}"
                ItemTemplate="{TemplateBinding ItemTemplate}"
                Opacity="{TemplateBinding Opacity}"
                BorderBrush="{StaticResource PhoneTextBoxEditBorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}"
                Padding="0,8"/>
        </Grid>
    </ControlTemplate>

  • 相关阅读:
    blk_update_request: I/O error, dev fd0, sector 0
    将MySQL数据迁移到Redis
    专职DBA-MySQL DAL(Data Access Layer)中间件总结
    搞笑聊天(一)
    看图写话(一)
    NFS存储服务
    rsync备份服务
    专职DBA-使用Python操作MySQL数据库
    如何解决SecureCRT无法选择Monaco等其他字体
    MySQL架构类型
  • 原文地址:https://www.cnblogs.com/piaocz/p/2221808.html
Copyright © 2011-2022 走看看