<Window x:Class="ObjectDataProvider_Sample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:ObjectDataProvider_Sample"
        mc:Ignorable="d"
       xmlns:sys="clr-namespace:System;assembly=mscorlib"
        Title="ObjectDataProviderSample" Height="150" Width="300">
    <Window.Resources>
        <ObjectDataProvider x:Key="obj1" ObjectType="{x:Type local:Demo}">
            <ObjectDataProvider.ConstructorParameters>
                <sys:String>Manfred Fischer</sys:String>
            </ObjectDataProvider.ConstructorParameters>
        </ObjectDataProvider>

        <ObjectDataProvider x:Key="obj2" ObjectInstance="{StaticResource obj1}" MethodName="DoSomething">
            <ObjectDataProvider.MethodParameters>
                <sys:Int32>12</sys:Int32>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>

        <ObjectDataProvider x:Key="obj3" ObjectType="{x:Type local:Demo}" MethodName="DoSomething2">
            <ObjectDataProvider.MethodParameters>
                <sys:Int32>17</sys:Int32>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
    </Window.Resources>
    <Window.Background>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="Black" Offset="0"/>
            <GradientStop Color="White" Offset="1"/>
        </LinearGradientBrush>
    </Window.Background>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Label Foreground="White" Grid.Row="0">Demo (Konstruktor):</Label>
        <Label Foreground="White" Grid.Row="1">Methodenaufruf:</Label>
        <Label Foreground="White" Grid.Row="2">Methodenaufruf (static):</Label>
        <TextBlock VerticalAlignment="Center" Foreground="White" Grid.Column="1" Grid.Row="0" Text="{Binding Name, Source={StaticResource obj1}}" />
        <TextBlock VerticalAlignment="Center" Foreground="White" Grid.Column="1" Grid.Row="1" Text="{Binding Source={StaticResource obj2}}" />
        <TextBlock VerticalAlignment="Center" Foreground="White" Grid.Column="1" Grid.Row="2" Text="{Binding Source={StaticResource obj3}}" />
    </Grid>
</Window>
