ScpProfiler/MainWindow.xaml (128 lines of code) (raw):

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:scpProfiler="clr-namespace:ScpProfiler" xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:system="clr-namespace:System;assembly=mscorlib" xmlns:core="clr-namespace:ScpControl.Shared.Core;assembly=ScpControl.Shared" x:Class="ScpProfiler.MainWindow" Title="Scp Gamepad Input Profile Manager" Height="857" Width="980" WindowStartupLocation="CenterScreen" Icon="xbox.ico" Initialized="Window_Initialized"> <Grid Background="#FF1B1B1B" x:Name="MainGrid"> <Grid.RowDefinitions> <RowDefinition Height="40" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Grid.DataContext> <scpProfiler:DualShockProfileViewModel /> </Grid.DataContext> <!-- Top navigation --> <DockPanel Grid.Row="0" LastChildFill="False"> <!-- Pad selection --> <Label Content="Current Pad:" FontSize="18" VerticalAlignment="Center" /> <ComboBox Height="30" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5" Width="100" SelectedIndex="0" SelectionChanged="CurrentPad_SelectionChanged"> <core:DsPadId>One</core:DsPadId> <core:DsPadId>Two</core:DsPadId> <core:DsPadId>Three</core:DsPadId> <core:DsPadId>Four</core:DsPadId> <core:DsPadId>All</core:DsPadId> </ComboBox> <!-- Actions --> <Button Margin="5" Click="EditButton_OnClick">Profiles &amp; Properties...</Button> <Button Margin="5" Click="SaveButton_Click">Save changes</Button> </DockPanel> <!-- Main area --> <controls:Accordion Grid.Row="1" Margin="10" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <!-- DualShock 3 Button mappings --> <controls:AccordionItem Header="Button mappings"> <ScrollViewer> <StackPanel> <scpProfiler:ButtonMappingEntryControl IconSource="Icons/48px-PS3_PSHome.png" IconToolTip="PS Home button" ButtonProfile="{Binding Path=CurrentProfile.Ps, Mode=TwoWay}" /> <scpProfiler:ButtonMappingEntryControl IconSource="Icons/48px-PS3_Circle.png" IconToolTip="Circle" ButtonProfile="{Binding Path=CurrentProfile.Circle, Mode=TwoWay}" /> <scpProfiler:ButtonMappingEntryControl IconSource="Icons/48px-PS3_Cross.png" IconToolTip="Cross" ButtonProfile="{Binding Path=CurrentProfile.Cross, Mode=TwoWay}" /> <scpProfiler:ButtonMappingEntryControl IconSource="Icons/48px-PS3_Sqaure.png" IconToolTip="Square" ButtonProfile="{Binding Path=CurrentProfile.Square, Mode=TwoWay}" /> <scpProfiler:ButtonMappingEntryControl IconSource="Icons/48px-PS3_Triangle.png" IconToolTip="Triangle" ButtonProfile="{Binding Path=CurrentProfile.Triangle, Mode=TwoWay}" /> <scpProfiler:ButtonMappingEntryControl IconSource="Icons/48px-PS3_Select.png" IconToolTip="Select" ButtonProfile="{Binding Path=CurrentProfile.Select, Mode=TwoWay}" /> <scpProfiler:ButtonMappingEntryControl IconSource="Icons/48px-PS3_Start.png" IconToolTip="Start" ButtonProfile="{Binding Path=CurrentProfile.Start, Mode=TwoWay}" /> <scpProfiler:ButtonMappingEntryControl IconSource="Icons/48px-PS3_L1.png" IconToolTip="Left shoulder" ButtonProfile="{Binding Path=CurrentProfile.LeftShoulder, Mode=TwoWay}" /> <scpProfiler:ButtonMappingEntryControl IconSource="Icons/48px-PS3_R1.png" IconToolTip="Right shoulder" ButtonProfile="{Binding Path=CurrentProfile.RightShoulder, Mode=TwoWay}" /> <scpProfiler:ButtonMappingEntryControl IconSource="Icons/48px-PS3_L2.png" IconToolTip="Left trigger" ButtonProfile="{Binding Path=CurrentProfile.LeftTrigger, Mode=TwoWay}" /> <scpProfiler:ButtonMappingEntryControl IconSource="Icons/48px-PS3_R2.png" IconToolTip="Right trigger" ButtonProfile="{Binding Path=CurrentProfile.RightTrigger, Mode=TwoWay}" /> <scpProfiler:ButtonMappingEntryControl IconSource="Icons/48px-PS3_L3.png" IconToolTip="Left thumb" ButtonProfile="{Binding Path=CurrentProfile.LeftThumb, Mode=TwoWay}" /> <scpProfiler:ButtonMappingEntryControl IconSource="Icons/48px-PS3_R3.png" IconToolTip="Right thumb" ButtonProfile="{Binding Path=CurrentProfile.RightThumb, Mode=TwoWay}" /> <scpProfiler:ButtonMappingEntryControl IconSource="Icons/Ds4/dpad_up.png" IconToolTip="D-Pad up" ButtonProfile="{Binding Path=CurrentProfile.Up, Mode=TwoWay}" /> <scpProfiler:ButtonMappingEntryControl IconSource="Icons/Ds4/dpad_right.png" IconToolTip="D-Pad right" ButtonProfile="{Binding Path=CurrentProfile.Right, Mode=TwoWay}" /> <scpProfiler:ButtonMappingEntryControl IconSource="Icons/Ds4/dpad_down.png" IconToolTip="D-Pad down" ButtonProfile="{Binding Path=CurrentProfile.Down, Mode=TwoWay}" /> <scpProfiler:ButtonMappingEntryControl IconSource="Icons/Ds4/dpad_left.png" IconToolTip="D-Pad left" ButtonProfile="{Binding Path=CurrentProfile.Left, Mode=TwoWay}" /> </StackPanel> </ScrollViewer> </controls:AccordionItem> <!-- Axis mappings --> <controls:AccordionItem Header="Axis mappings &amp; settings" IsEnabled="False"> <Grid> <scpProfiler:DpadAxisControl /> </Grid> </controls:AccordionItem> <!-- LED settings --> <controls:AccordionItem Header="DualShock 3 LED behaviour" IsEnabled="False" /> <!-- Lightbar settings --> <controls:AccordionItem Header="DualShock 4 Lightbar behaviour" IsEnabled="False" /> <!-- Touchpad settings --> <controls:AccordionItem Header="DualShock 4 Touchpad settings" IsEnabled="False" /> <!-- Rumble settings --> <controls:AccordionItem Header="Rumble settings" IsEnabled="False" /> </controls:Accordion> <!-- New profile dialog --> <xctk:ChildWindow Grid.Row="1" Caption="Add, modify or remove mapping profiles" x:Name="EditProfileChildWindow" Width="700" Height="450" Background="#FF2B2B2B" WindowBackground="#FF00AADE" Left="150" Top="50" HorizontalAlignment="Left" VerticalAlignment="Top"> <!-- Profile Properties --> <xctk:CollectionControl x:Name="ProfilesCollectionControl" ItemsSource="{Binding Path=Profiles, UpdateSourceTrigger=PropertyChanged, IsAsync=True}" SelectedItem="{Binding Path=CurrentProfile, Mode=TwoWay}" Margin="10" ItemAdded="ProfilesCollectionControl_OnItemAdded" ItemDeleted="ProfilesCollectionControl_OnItemDeleted"/> </xctk:ChildWindow> </Grid> </Window>