TreeView is used for displaying hierarchical data. Individual items in a treeview is called TreeViewItem. Here I am declaratively creating a TreeView.
Output
Constructing a treeview with code
private void Window_Loaded(object sender, RoutedEventArgs e)
{
TreeViewItem tvwIndia = new TreeViewItem();
tvwIndia.Header = "India";
treeView1.Items.Add(tvwIndia);
TreeViewItem tvwKerala = new TreeViewItem();
tvwKerala.Header = "Kerala";
tvwIndia.Items.Add(tvwKerala);
TreeViewItem tvwKochi = new TreeViewItem();
tvwKochi.Header = "Kochi";
tvwKerala.Items.Add(tvwKochi);
}
Showing posts with label Xaml. Show all posts
Showing posts with label Xaml. Show all posts
Monday, June 29, 2009
WPF Treeview
Labels:
Shalvin,
TreeView,
WPF,
Wpf Control,
WPF TreeView,
Xaml
Monday, October 6, 2008
WPF Styles
Styles are equivalent to CSS in html. Lets see how to create Styles in WPF.Inside the Window Xaml tag add a Window.Resource section.In the Style tag's TagetType you can specify to what type of control you want the style to apply. Using Setters you can specity the Property and and its corresponding value.
Here is the result
In this example I am setting the Background, Width and Opacity properties for Button. All the buttons in the form will inherit these properties thereby rendering a consistant look and feel.
Labels:
Shalvin,
silverlight,
Silverlight Styles,
Styles,
WPF,
WPF Styles,
Xaml
Subscribe to:
Posts (Atom)