JD2022-TU1/main/tools/apps/Soundwich/App.xaml

378 lines
35 KiB
XML

<wpf:WpfApplication x:Class="Soundwich.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wpf="clr-namespace:Plume.Application.WPF;assembly=Plume.Application.WPF"
xmlns:properties="clr-namespace:Plume.Properties;assembly=Plume.Properties"
xmlns:grids="http://schemas.actiprosoftware.com/winfx/xaml/grids"
xmlns:controlsEx="clr-namespace:JD.Soundwich.Core.SounwichStudio.OldSoundwich.ControlsEx;assembly=JD.Soundwich.Core"
xmlns:soundwich="clr-namespace:JD.Soundwich.Core.SounwichStudio.OldSoundwich.Soundwich;assembly=JD.Soundwich.Core"
xmlns:core="clr-namespace:JD.Soundwich.Core.SounwichStudio.OldSoundwich.Core;assembly=JD.Soundwich.Core"
xmlns:converters="clr-namespace:JD.Soundwich.Core.SounwichStudio.OldSoundwich.Core.Converters;assembly=JD.Soundwich.Core"
xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared"
Icon="/Resources/Sandwich32x32.png">
<Application.Resources>
<converters:SringIsNullOrWhitespace x:Key="SringIsNullOrWhitespace" />
<converters:StringToBool x:Key="StringToBool" />
<converters:CollectionContainsConverter x:Key="CollectionContainsConverter" />
<Style TargetType="properties:PropertiesToolWindow">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="properties:PropertiesToolWindow">
<StackPanel>
<grids:PropertyGrid DataObject="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=DataObject}"
DataObjects="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=DataObjects}"
CollectionPropertyDisplayMode="Expandable"
DataFactory="{Binding Source={x:Static core:SoundwichDataFactory.Instance}}">
<grids:PropertyGrid.PropertyEditors>
<grids:PropertyEditor PropertyType="soundwich:BoolPropertyViewItemEx">
<grids:PropertyEditor.ValueTemplate>
<DataTemplate DataType="soundwich:BoolPropertyViewItemEx">
<CheckBox IsChecked="{Binding Path=Value, NotifyOnSourceUpdated=True,NotifyOnTargetUpdated=True, Converter={StaticResource StringToBool}}"></CheckBox>
</DataTemplate>
</grids:PropertyEditor.ValueTemplate>
</grids:PropertyEditor>
<grids:PropertyEditor PropertyType="soundwich:WaveFilePropertyViewItemEx">
<grids:PropertyEditor.ValueTemplate>
<DataTemplate DataType="soundwich:WaveFilePropertyViewItemEx">
<DockPanel>
<TextBlock Text="{Binding Path=Value}"></TextBlock>
<Button Command="{Binding Path=OpendDialog}" CommandParameter="{Binding}">...</Button>
</DockPanel>
</DataTemplate>
</grids:PropertyEditor.ValueTemplate>
</grids:PropertyEditor>
<grids:PropertyEditor PropertyType="soundwich:SaveFilePropertyViewItemEx">
<grids:PropertyEditor.ValueTemplate>
<DataTemplate DataType="soundwich:SaveFilePropertyViewItemEx">
<DockPanel>
<TextBlock Text="{Binding Path=Value}"></TextBlock>
<Button Command="{Binding Path=OpendDialog}" CommandParameter="{Binding}">...</Button>
</DockPanel>
</DataTemplate>
</grids:PropertyEditor.ValueTemplate>
</grids:PropertyEditor>
<grids:PropertyEditor PropertyType="soundwich:BitRatePropertyViewItemEx">
<grids:PropertyEditor.ValueTemplate>
<DataTemplate DataType="soundwich:BitRatePropertyViewItemEx">
<TextBlock Text="{Binding Path=Text}"></TextBlock>
</DataTemplate>
</grids:PropertyEditor.ValueTemplate>
</grids:PropertyEditor>
<grids:PropertyEditor PropertyType="soundwich:BankPropertyViewItemEx">
<grids:PropertyEditor.ValueTemplate>
<DataTemplate DataType="core:PropertiesViewItemExDataModel">
<ContentControl>
<ContentControl.Style>
<Style TargetType="ContentControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<ComboBox shared:HintProperties.Hint="- Select Value -" ItemsSource="{Binding Path=Target.Values, Mode=OneWay}" SelectedItem="{Binding Path=Target.Value}" DataContext="{Binding}" />
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Value="False">
<DataTrigger.Binding>
<MultiBinding Converter="{StaticResource CollectionContainsConverter}">
<Binding Path="Target.Values" Mode="OneWay"></Binding>
<Binding Path="Target.Value"></Binding>
</MultiBinding>
</DataTrigger.Binding>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<TextBlock Text="{Binding Path=Target.Value, Mode=OneWay}" Foreground="Red">
<TextBlock.ToolTip>
<StackPanel Orientation="Vertical">
<TextBox Text="The value is not in the related collection"></TextBox>
<ListView ItemsSource="{Binding Path=Target.Values, Mode=OneWay}"></ListView>
</StackPanel>
</TextBlock.ToolTip>
</TextBlock>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</ContentControl.Style>
</ContentControl>
</DataTemplate>
</grids:PropertyEditor.ValueTemplate>
</grids:PropertyEditor>
<grids:PropertyEditor PropertyType="soundwich:WavePropertyViewItemEx">
<grids:PropertyEditor.ValueTemplate>
<DataTemplate DataType="core:PropertiesViewItemExDataModel">
<ContentControl>
<ContentControl.Style>
<Style TargetType="ContentControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<ComboBox shared:HintProperties.Hint="- Select Value -" ItemsSource="{Binding Path=Target.Values, Mode=OneWay}" SelectedItem="{Binding Path=Target.Value}" DataContext="{Binding}" />
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Value="False">
<DataTrigger.Binding>
<MultiBinding Converter="{StaticResource CollectionContainsConverter}">
<Binding Path="Target.Values" Mode="OneWay"></Binding>
<Binding Path="Target.Value"></Binding>
</MultiBinding>
</DataTrigger.Binding>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<TextBlock Text="{Binding Path=Target.Value, Mode=OneWay}" Foreground="Red">
<TextBlock.ToolTip>
<StackPanel Orientation="Vertical">
<TextBox Text="The value is not in the related collection"></TextBox>
<ListView ItemsSource="{Binding Path=Target.Values, Mode=OneWay}"></ListView>
</StackPanel>
</TextBlock.ToolTip>
</TextBlock>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</ContentControl.Style>
</ContentControl>
</DataTemplate>
</grids:PropertyEditor.ValueTemplate>
</grids:PropertyEditor>
<grids:PropertyEditor PropertyType="soundwich:JDMenuMusicPropertyViewItemEx">
<grids:PropertyEditor.ValueTemplate>
<DataTemplate DataType="core:PropertiesViewItemExDataModel">
<ContentControl>
<ContentControl.Style>
<Style TargetType="ContentControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<ComboBox shared:HintProperties.Hint="- Select Value -" ItemsSource="{Binding Path=Target.Values, Mode=OneWay}" SelectedItem="{Binding Path=Target.Value}" DataContext="{Binding}" />
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Value="False">
<DataTrigger.Binding>
<MultiBinding Converter="{StaticResource CollectionContainsConverter}">
<Binding Path="Target.Values" Mode="OneWay"></Binding>
<Binding Path="Target.Value"></Binding>
</MultiBinding>
</DataTrigger.Binding>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<TextBlock Text="{Binding Path=Target.Value, Mode=OneWay}" Foreground="Red">
<TextBlock.ToolTip>
<StackPanel Orientation="Vertical">
<TextBox Text="The value is not in the related collection"></TextBox>
<ListView ItemsSource="{Binding Path=Target.Values, Mode=OneWay}"></ListView>
</StackPanel>
</TextBlock.ToolTip>
</TextBlock>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</ContentControl.Style>
</ContentControl>
</DataTemplate>
</grids:PropertyEditor.ValueTemplate>
</grids:PropertyEditor>
<grids:PropertyEditor PropertyType="soundwich:JDMusicMultiTrackPropertyViewItemEx">
<grids:PropertyEditor.ValueTemplate>
<DataTemplate DataType="core:PropertiesViewItemExDataModel">
<ContentControl>
<ContentControl.Style>
<Style TargetType="ContentControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<ComboBox shared:HintProperties.Hint="- Select Value -" ItemsSource="{Binding Path=Target.Values, Mode=OneWay}" SelectedItem="{Binding Path=Target.Value}" DataContext="{Binding}" />
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Value="False">
<DataTrigger.Binding>
<MultiBinding Converter="{StaticResource CollectionContainsConverter}">
<Binding Path="Target.Values" Mode="OneWay"></Binding>
<Binding Path="Target.Value"></Binding>
</MultiBinding>
</DataTrigger.Binding>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<TextBlock Text="{Binding Path=Target.Value, Mode=OneWay}" Foreground="Red">
<TextBlock.ToolTip>
<StackPanel Orientation="Vertical">
<TextBox Text="The value is not in the related collection"></TextBox>
<ListView ItemsSource="{Binding Path=Target.Values, Mode=OneWay}"></ListView>
</StackPanel>
</TextBlock.ToolTip>
</TextBlock>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</ContentControl.Style>
</ContentControl>
</DataTemplate>
</grids:PropertyEditor.ValueTemplate>
</grids:PropertyEditor>
<grids:PropertyEditor PropertyType="soundwich:JDSoundEffectPropertyViewItemEx">
<grids:PropertyEditor.ValueTemplate>
<DataTemplate DataType="core:PropertiesViewItemExDataModel">
<ContentControl>
<ContentControl.Style>
<Style TargetType="ContentControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<ComboBox shared:HintProperties.Hint="- Select Value -" ItemsSource="{Binding Path=Target.Values, Mode=OneWay}" SelectedItem="{Binding Path=Target.Value}" DataContext="{Binding}" />
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Value="False">
<DataTrigger.Binding>
<MultiBinding Converter="{StaticResource CollectionContainsConverter}">
<Binding Path="Target.Values" Mode="OneWay"></Binding>
<Binding Path="Target.Value"></Binding>
</MultiBinding>
</DataTrigger.Binding>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<TextBlock Text="{Binding Path=Target.Value, Mode=OneWay}" Foreground="Red">
<TextBlock.ToolTip>
<StackPanel Orientation="Vertical">
<TextBox Text="The value is not in the related collection"></TextBox>
<ListView ItemsSource="{Binding Path=Target.Values, Mode=OneWay}"></ListView>
</StackPanel>
</TextBlock.ToolTip>
</TextBlock>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</ContentControl.Style>
</ContentControl>
</DataTemplate>
</grids:PropertyEditor.ValueTemplate>
</grids:PropertyEditor>
<grids:PropertyEditor PropertyType="soundwich:JDRemoteSoundEffectPropertyViewItemEx">
<grids:PropertyEditor.ValueTemplate>
<DataTemplate DataType="core:PropertiesViewItemExDataModel">
<ContentControl>
<ContentControl.Style>
<Style TargetType="ContentControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<ComboBox shared:HintProperties.Hint="- Select Value -" ItemsSource="{Binding Path=Target.Values, Mode=OneWay}" SelectedItem="{Binding Path=Target.Value}" DataContext="{Binding}" />
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Value="False">
<DataTrigger.Binding>
<MultiBinding Converter="{StaticResource CollectionContainsConverter}">
<Binding Path="Target.Values" Mode="OneWay"></Binding>
<Binding Path="Target.Value"></Binding>
</MultiBinding>
</DataTrigger.Binding>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<TextBlock Text="{Binding Path=Target.Value, Mode=OneWay}" Foreground="Red">
<TextBlock.ToolTip>
<StackPanel Orientation="Vertical">
<TextBox Text="The value is not in the related collection"></TextBox>
<ListView ItemsSource="{Binding Path=Target.Values, Mode=OneWay}"></ListView>
</StackPanel>
</TextBlock.ToolTip>
</TextBlock>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</ContentControl.Style>
</ContentControl>
</DataTemplate>
</grids:PropertyEditor.ValueTemplate>
</grids:PropertyEditor>
<grids:PropertyEditor PropertyType="soundwich:JDBusMixPropertyViewItemEx">
<grids:PropertyEditor.ValueTemplate>
<DataTemplate DataType="core:PropertiesViewItemExDataModel">
<ContentControl>
<ContentControl.Style>
<Style TargetType="ContentControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<ComboBox shared:HintProperties.Hint="- Select Value -" ItemsSource="{Binding Path=Target.Values, Mode=OneWay}" SelectedItem="{Binding Path=Target.Value}" DataContext="{Binding}" />
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Value="False">
<DataTrigger.Binding>
<MultiBinding Converter="{StaticResource CollectionContainsConverter}">
<Binding Path="Target.Values" Mode="OneWay"></Binding>
<Binding Path="Target.Value"></Binding>
</MultiBinding>
</DataTrigger.Binding>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<TextBlock Text="{Binding Path=Target.Value, Mode=OneWay}" Foreground="Red">
<TextBlock.ToolTip>
<StackPanel Orientation="Vertical">
<TextBox Text="The value is not in the related collection"></TextBox>
<ListView ItemsSource="{Binding Path=Target.Values, Mode=OneWay}"></ListView>
</StackPanel>
</TextBlock.ToolTip>
</TextBlock>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</ContentControl.Style>
</ContentControl>
</DataTemplate>
</grids:PropertyEditor.ValueTemplate>
</grids:PropertyEditor>
<grids:PropertyEditor PropertyType="controlsEx:PropertiesViewItemEx">
<grids:PropertyEditor.ValueTemplate>
<DataTemplate DataType="controlsEx:PropertiesViewItemEx">
<TextBox Text="{Binding Path=Value}" TextWrapping="Wrap"></TextBox>
</DataTemplate>
</grids:PropertyEditor.ValueTemplate>
</grids:PropertyEditor>
</grids:PropertyGrid.PropertyEditors>
</grids:PropertyGrid>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Application.Resources>
</wpf:WpfApplication>