• ListView和TextBox,x:Null


    <Window x:Class="WpfApp_Delete.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MainWindow" Height="350" Width="525"
            xmlns:Custom="clr-namespace:WpfApp_Delete"
            >
        <Window.Resources>
            <Custom:DemoList x:Key="MyList">
                <Custom:Demo Address="黄石" Sex="男" />
                <Custom:Demo Address="铁山" Sex="女"/>
            </Custom:DemoList>
            <Custom:Demo x:Key="MyDemo" Address="黄石" Sex="男" />
        </Window.Resources>
        <Grid DataContext="{StaticResource MyList}">
            <Grid.Resources>
                <!--x:Null的事例-->
                <Style TargetType="Button">
                    <Setter Property="Width" Value="200"/>
                </Style>
                <Style TargetType="ListViewItem">
                    <Setter Property="HorizontalContentAlignment" Value="Center"/>
                </Style>
            </Grid.Resources>
            <TextBox Height="23" HorizontalAlignment="Left" Margin="10,10,0,0" Name="textBox1" Text="{Binding ElementName=lvRoot, Path=SelectedItem.Sex}" VerticalAlignment="Top" Width="120" />
            <ListView Name="lvRoot" Height="100" HorizontalAlignment="Left" Margin="10,43,0,0" VerticalAlignment="Top" Width="481" ItemsSource="{Binding}" >
                <ListView.View>
                    <GridView>
                        <GridViewColumn DisplayMemberBinding="{Binding Address}" Header="住址" Width="100"/>
                        <GridViewColumn DisplayMemberBinding="{Binding Sex}" Header="性别" Width="100"/>
                    </GridView>
                </ListView.View>
            </ListView>
            <!--x:Null的事例-->
            <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="35,157,0,0" Name="button1" VerticalAlignment="Top" />
            <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="265,157,0,0" Name="button2" Style="{x:Null}" VerticalAlignment="Top" />
        </Grid>
    </Window>
  • 相关阅读:
    java线程间的协作
    java线程间的共享
    java多线程基础API
    java并发编程基础概念
    如何设计一套规则引擎系统
    Stream—一个早产的婴儿
    Java函数式编程的前生今世
    关于微服务划分的一些思考
    如何更优雅的给控制器 “减负”
    PHP简洁之道
  • 原文地址:https://www.cnblogs.com/kelei12399/p/2582606.html
Copyright © 2020-2023  润新知