Find file
Fetching contributors…
Cannot retrieve contributors at this time
50 lines (46 sloc) 1.76 KB
<UserControl
x:Class="Moq.Visualizer.MockVisualizerView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:v="clr-namespace:Moq.Visualizer">
<DockPanel>
<WrapPanel DockPanel.Dock="Top">
<TextBlock Text="Behavior:" Width="80" />
<TextBlock Text="{Binding Behavior}" />
</WrapPanel>
<WrapPanel DockPanel.Dock="Top">
<TextBlock Text="Call Base:" Width="80" />
<TextBlock Text="{Binding CallBase}" />
</WrapPanel>
<WrapPanel DockPanel.Dock="Top">
<TextBlock Text="Default Value:" Width="80" />
<TextBlock Text="{Binding DefaultValue}" />
</WrapPanel>
<TreeView ItemsSource="{Binding Mocks}">
<TreeView.Resources>
<Style TargetType="TreeViewItem">
<Setter Property="IsExpanded" Value="{Binding IsExpanded}" />
</Style>
<HierarchicalDataTemplate DataType="{x:Type v:ContainerViewModel}" ItemsSource="{Binding Children}">
<TextBlock Foreground="DarkGray">
<TextBlock.Text>
<MultiBinding StringFormat="{}{0} ({1})">
<Binding Path="Name" />
<Binding Path="Children.Count" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type v:SetupViewModel}" ItemsSource="{Binding Containers}">
<TextBlock Text="{Binding SetupExpression}" />
</HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type v:CallViewModel}" >
<TextBlock Text="{Binding MethodCall}" />
</DataTemplate>
<HierarchicalDataTemplate DataType="{x:Type v:MockViewModel}" ItemsSource="{Binding Containers}">
<TextBlock Text="{Binding MockedType}" />
</HierarchicalDataTemplate>
</TreeView.Resources>
</TreeView>
</DockPanel>
</UserControl>