forked from dsharlet/LiveSPICE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSimulationInterface.xaml
87 lines (87 loc) · 5.87 KB
/
SimulationInterface.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<UserControl x:Class="LiveSPICEVst.SimulationInterface"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:LiveSPICEVst"
xmlns:AudioPlugSharpWPF="clr-namespace:AudioPlugSharpWPF;assembly=AudioPlugSharpWPF"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/LiveSPICEVst;component/Themes/Generic.xaml"/>
<ResourceDictionary Source="/AudioPlugSharpWPF;component/Themes/Generic.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<ItemsControl ItemsSource="{Binding InteractiveComponents}" HorizontalAlignment="Center" VerticalAlignment="Top">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<DockPanel>
<TextBlock DockPanel.Dock="Top" Text="{Binding Name}"
FontSize="14" FontWeight="Bold" HorizontalAlignment="Center" Margin="2">
</TextBlock>
<ContentControl DockPanel.Dock="Top" Content="{Binding}">
<ContentControl.Style>
<Style TargetType="ContentControl">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<StackPanel>
<AudioPlugSharpWPF:Dial x:Name="ParameterDial"
Minimum="0" Maximum="1" Value="{Binding PotValue}"
Margin="2,0,2,0"/>
<Popup PlacementTarget="{Binding ElementName=ParameterDial}" Placement="Center" VerticalOffset="25"
IsOpen="{Binding IsMouseCaptured, ElementName=ParameterDial, Mode=OneWay}"
AllowsTransparency = "True" PopupAnimation = "Fade">
<Border Background="White" BorderBrush="Gray" BorderThickness="1">
<TextBlock Text="{Binding PotValue, StringFormat=N2}" Margin="2"/>
</Border>
</Popup>
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=DataContext, Converter={StaticResource OjbectTypeConverter}}" Value="{x:Type local:DoubleThrowWrapper}">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<ToggleButton HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2" IsChecked="{Binding Engaged, Mode=TwoWay}"
Style="{StaticResource PowerButton}">
</ToggleButton>
</DataTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=DataContext, Converter={StaticResource OjbectTypeConverter}}" Value="{x:Type local:MultiThrowWrapper}">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<ComboBox HorizontalAlignment="Center" VerticalAlignment="Center" SelectedValue="{Binding Position, Mode=TwoWay}">
<sys:Int32>0</sys:Int32>
<sys:Int32>1</sys:Int32>
<sys:Int32>2</sys:Int32>
</ComboBox>
</DataTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</ContentControl.Style>
</ContentControl>
</DockPanel>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</UserControl>