思考、创新、坚持、执行

如果创新能改变人类的消费习惯,那么将对它所进入的领域产生深远影响,进而成就一家伟大的世界级企业;云翻译平台www.139fanyi.com.cn要去一切中心化

 

WPF嵌入式资源使用方法

<Page x:Class="WpfWebApp.Page1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:uc="clr-namespace:WpfLibruary;assembly=WpfLibruary"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:WpfWebApp"
    Title="Page1" Height="332" Width="757" VerticalAlignment="Top">
    <Page.Resources>
        <local:PersonCollection x:Key="PersonC">
            <local:Person Id="1" Name="Cgc1" />
            <local:Person Id="2" Name="Cgc2" />
            <local:Person Id="3" Name="Cgc3" />
        </local:PersonCollection>
    </Page.Resources>
    <Grid Height="289">
        <TextBlock FontSize="24" TextWrapping="Wrap" Margin="0,0,0,-19.998">
            <Hyperlink x:Name="LnkPre" NavigateUri="Page2.xaml" Foreground="Black">
                Enter Page2
             </Hyperlink>
        </TextBlock>
        <Button Margin="358,43,214,0" Name="button1" Click="button1_Click" Height="49.024" VerticalAlignment="Top">Button</Button>
        <ListBox  ItemsSource="{StaticResource  PersonC}" IsSynchronizedWithCurrentItem="True" x:Name="LstPerson" HorizontalAlignment="Left" Width="297" Height="131" VerticalAlignment="Top">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <DockPanel>
                        <TextBlock Text="{Binding Path=Id}"></TextBlock>
                        <TextBlock Text="分分:"></TextBlock>
                        <TextBlock Text="{Binding Path=Name}"></TextBlock>
                    </DockPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</Page>

 

 public class Person
    {
        public Person()
        { }
        public Person(Int32 Id, String Name)
        {
            this.Id = Id;
            this.Name = Name;
        }
        public Int32 Id
        {
            get;
            set;
        }
        public String Name
        {
            get;
            set;
        }
    }
    public class PersonCollection : System.Collections.ObjectModel.ObservableCollection<Person>
    {

      
    }

http://www.infoq.com/cn/news/2008/04/silverlight2-tutorials

http://www.cnblogs.com/Clingingboy/archive/2008/06/25/1230047.html

posted on 2008-04-16 15:51  铭天  阅读(1043)  评论(0编辑  收藏  举报

导航

中国翻译公司| 北京翻译公司| 北京翻译公司| 语通全球翻译公司| 同声传译|