KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
The following example fills the ItemsControl with a List of BackupDirectories which I get from code. How can I change this so that I get the same information from the app.config file? XAML: <Window x:Class="TestReadMultipler2343.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Grid Margin="10"> <Grid.RowDefinitions> <RowDefinition Height="30"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="120"/> <ColumnDefinition Width="160"/> </Grid.ColumnDefinitions> <TextBlock Grid.Row="0" Grid.Column="0" Text="Title:"/> <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Title}"/> <TextBlock Grid.Row="1" Grid.Column="0" Text="Backup Directories:"/> <ItemsControl Grid.Row="1" Grid.Column="1" ItemsSource="{Binding BackupDirectories}"/> </Grid> </Window> code-behind: using System.Collections.Generic; using System.Windows; using System.Configuration; using System.ComponentModel; namespace TestReadMultipler2343 { public partial class Window1 : Window, INotifyPropertyChanged { #region ViewModelProperty: Title private string _title; public string Title { get { return _title; } set { _title = value;
Tags (comma-separated)
Save Edits
Cancel