mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
208 lines
11 KiB
XML
208 lines
11 KiB
XML
<UserControl x:Class="Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings.DataBindingView"
|
|
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
|
xmlns:converters="clr-namespace:Artemis.UI.Converters"
|
|
xmlns:utilities="clr-namespace:Artemis.UI.Utilities"
|
|
xmlns:dd="urn:gong-wpf-dragdrop"
|
|
xmlns:s="https://github.com/canton7/Stylet"
|
|
xmlns:local="clr-namespace:Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="450" d:DesignWidth="800"
|
|
d:DataContext="{d:DesignInstance local:DataBindingViewModel}">
|
|
<UserControl.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="pack://application:,,,/Artemis.UI;component/ResourceDictionaries/DisplayConditions.xaml" />
|
|
<ResourceDictionary>
|
|
<converters:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />
|
|
<utilities:BindingProxy x:Key="DataContextProxy" Data="{Binding}" />
|
|
<DataTemplate x:Key="DataModelDataTemplate">
|
|
<Control x:Name="TemplateControl" Focusable="False" Template="{StaticResource DataModelSelectionTemplate}" />
|
|
<DataTemplate.Triggers>
|
|
<DataTrigger Binding="{Binding Data.ShowDataModelValues.Value, Source={StaticResource DataContextProxy}}" Value="True">
|
|
<Setter TargetName="TemplateControl" Property="Template" Value="{StaticResource DataModelSelectionTemplateWithValues}" />
|
|
</DataTrigger>
|
|
</DataTemplate.Triggers>
|
|
</DataTemplate>
|
|
</ResourceDictionary>
|
|
</ResourceDictionary.MergedDictionaries>
|
|
</ResourceDictionary>
|
|
</UserControl.Resources>
|
|
|
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
|
<Grid Margin="10 0">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="0.75*" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid Margin="0 5 5 0">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="48" />
|
|
<RowDefinition Height="48" />
|
|
<RowDefinition Height="48" />
|
|
<RowDefinition Height="48" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<StackPanel Grid.Row="0" Margin="-3 0 0 0">
|
|
<Label FontSize="10" Foreground="{StaticResource MaterialDesignNavigationItemSubheader}" Margin="0 0 0 2">Source</Label>
|
|
<Button Background="#ab47bc"
|
|
BorderBrush="#ab47bc"
|
|
Style="{StaticResource DisplayConditionButton}"
|
|
ToolTip="{Binding SelectedLeftSideProperty.DisplayPropertyPath}"
|
|
IsEnabled="{Binding IsDataBindingEnabled}"
|
|
HorizontalAlignment="Left">
|
|
<Button.ContextMenu>
|
|
<ContextMenu ItemsSource="{Binding LeftSideDataModel.Children}" IsOpen="{Binding LeftSideDataModelOpen, Mode=OneWayToSource}">
|
|
<ContextMenu.ItemContainerStyle>
|
|
<Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource MaterialDesignMenuItem}">
|
|
<Setter Property="ItemsSource" Value="{Binding Children}" />
|
|
<Setter Property="Command" Value="{Binding Data.SelectLeftPropertyCommand, Source={StaticResource DataContextProxy}}" />
|
|
<Setter Property="CommandParameter" Value="{Binding}" />
|
|
<Setter Property="CommandTarget" Value="{Binding}" />
|
|
<Setter Property="IsEnabled" Value="{Binding IsMatchingFilteredTypes}" />
|
|
<Setter Property="IsSubmenuOpen" Value="{Binding IsVisualizationExpanded, Mode=TwoWay}" />
|
|
<Setter Property="HeaderTemplate" Value="{StaticResource DataModelDataTemplate}" />
|
|
</Style>
|
|
</ContextMenu.ItemContainerStyle>
|
|
</ContextMenu>
|
|
</Button.ContextMenu>
|
|
<Grid>
|
|
<TextBlock Text="{Binding SelectedLeftSideProperty.PropertyDescription.Name}"
|
|
Visibility="{Binding SelectedLeftSideProperty, Converter={StaticResource NullToVisibilityConverter}}" />
|
|
<TextBlock Text="« Select a property »"
|
|
FontStyle="Italic"
|
|
Visibility="{Binding SelectedLeftSideProperty, Converter={StaticResource NullToVisibilityConverter}, ConverterParameter=Inverted}" />
|
|
</Grid>
|
|
</Button>
|
|
</StackPanel>
|
|
|
|
<ComboBox Grid.Row="1"
|
|
Style="{StaticResource MaterialDesignFloatingHintComboBox}"
|
|
materialDesign:HintAssist.Hint="Mode"
|
|
MinWidth="128"
|
|
IsEnabled="{Binding IsDataBindingEnabled}">
|
|
<ComboBoxItem>
|
|
Replace value
|
|
</ComboBoxItem>
|
|
<ComboBoxItem>
|
|
Add to value
|
|
</ComboBoxItem>
|
|
<ComboBoxItem>
|
|
Subtract from value
|
|
</ComboBoxItem>
|
|
</ComboBox>
|
|
|
|
<StackPanel Grid.Row="2">
|
|
<TextBox Style="{StaticResource MaterialDesignFloatingHintTextBox}"
|
|
Text="200"
|
|
materialDesign:TextFieldAssist.HasClearButton="True"
|
|
materialDesign:TextFieldAssist.SuffixText="ms"
|
|
materialDesign:HintAssist.Hint="Smoothing time"
|
|
IsEnabled="{Binding IsDataBindingEnabled}" />
|
|
</StackPanel>
|
|
|
|
<ComboBox Grid.Row="3"
|
|
Style="{StaticResource MaterialDesignFloatingHintComboBox}"
|
|
materialDesign:HintAssist.Hint="Smoothing type"
|
|
MinWidth="128"
|
|
IsEnabled="{Binding IsDataBindingEnabled}">
|
|
<ComboBoxItem>
|
|
Ease in
|
|
</ComboBoxItem>
|
|
<ComboBoxItem>
|
|
Ease out
|
|
</ComboBoxItem>
|
|
<ComboBoxItem>
|
|
Ease in and out
|
|
</ComboBoxItem>
|
|
</ComboBox>
|
|
|
|
<materialDesign:Card Grid.Row="4" Grid.ColumnSpan="2" Margin="0 5 0 0">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<TextBlock Grid.Row="0" Margin="10 10 4 0">
|
|
Test result
|
|
</TextBlock>
|
|
<Separator Grid.Row="1" Style="{StaticResource MaterialDesignLightSeparator}" Margin="0" />
|
|
<Grid Grid.Row="2" Margin="10 4 10 10">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<TextBlock Margin="0 2">Input</TextBlock>
|
|
<TextBlock Grid.Row="0" Grid.Column="1" Margin="0 2" FontFamily="Consolas">1250</TextBlock>
|
|
|
|
<TextBlock Grid.Row="1" Grid.Column="0" Margin="0 2">Output</TextBlock>
|
|
<TextBlock Grid.Row="1" Grid.Column="1" Margin="0 2" FontFamily="Consolas">909</TextBlock>
|
|
</Grid>
|
|
</Grid>
|
|
</materialDesign:Card>
|
|
</Grid>
|
|
|
|
<Grid Grid.Column="1">
|
|
<Grid Margin="5 26 0 0">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<Button Style="{StaticResource MaterialDesignFlatMidBgButton}"
|
|
HorizontalAlignment="Left"
|
|
FontSize="12"
|
|
Padding="6 4"
|
|
Height="22"
|
|
IsEnabled="{Binding IsDataBindingEnabled}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<materialDesign:PackIcon Margin="0 -1 4 0" Kind="Plus" />
|
|
<TextBlock>
|
|
Add modifier
|
|
</TextBlock>
|
|
</StackPanel>
|
|
</Button>
|
|
|
|
<CheckBox Grid.Row="0"
|
|
Grid.Column="1"
|
|
Style="{StaticResource MaterialDesignCheckBox}"
|
|
HorizontalAlignment="Right"
|
|
VerticalAlignment="Top"
|
|
IsChecked="{Binding IsDataBindingEnabled}">
|
|
Enable data binding
|
|
</CheckBox>
|
|
|
|
<ListBox Grid.Row="1"
|
|
Grid.Column="0"
|
|
Grid.ColumnSpan="2"
|
|
ItemsSource="{Binding ModifierViewModels}"
|
|
materialDesign:RippleAssist.IsDisabled="True"
|
|
dd:DragDrop.IsDragSource="True"
|
|
dd:DragDrop.IsDropTarget="True"
|
|
dd:DragDrop.UseDefaultDragAdorner="True"
|
|
dd:DragDrop.DropHandler="{Binding}"
|
|
HorizontalContentAlignment="Stretch">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<ContentControl s:View.Model="{Binding}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" IsTabStop="False" />
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</ScrollViewer>
|
|
</UserControl> |