zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    hdu3457(有向图的dp问题)
    nyoj16矩形嵌套(第一道dp关于dag的题目)
    noj1475(递推题)统计多少个1
    hdu1331(记忆化搜索)
    hdu1142(dj+记忆化搜索)
    hdu1978(记忆化搜索)
    用广搜实现的spfa
    hdu1428(记忆化搜索)
    hdu1078(记忆化搜索)
    poj3261(后缀数组)
  • 原文地址:https://www.cnblogs.com/single/p/1156353.html
Copyright © 2011-2022 走看看