Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions FF7RebirthDataObjectEditor/App.xaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<Application x:Class="FF7RebirthDataObjectEditor.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
ThemeMode="System"
StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Fluent;component/Themes/Fluent.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<TargetFramework>net9.0-windows7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UseWPF>true</UseWPF>
Expand Down
27 changes: 26 additions & 1 deletion FF7RebirthDataObjectEditor/PropertyGridControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using FF7R2.DataObject;
using FF7RebirthDataObjectEditor.FF7Types;

namespace FF7RebirthDataObjectEditor;

public partial class PropertyGridControl : UserControl
{
public ObservableCollection<EntryRow> AssetEntries
private SolidColorBrush transparentBrush = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));
private Style? buttonStyle;

public ObservableCollection<EntryRow> AssetEntries
{
get { return (ObservableCollection<EntryRow>)GetValue(AssetEntriesProperty); }
set { SetValue(AssetEntriesProperty, value); }
Expand All @@ -21,6 +25,22 @@ public ObservableCollection<EntryRow> AssetEntries
public PropertyGridControl()
{
InitializeComponent();
Style? baseStyle = Application.Current.TryFindResource(typeof(Button)) as Style;
if (baseStyle == null)
return;
buttonStyle = new Style()
{
BasedOn = baseStyle,
TargetType = typeof(Button)
};
DataTrigger rowSelectedTrigger = new DataTrigger();
var binding = new Binding("IsSelected");
binding.RelativeSource = new RelativeSource(RelativeSourceMode.FindAncestor, typeof(DataGridRow),1);
rowSelectedTrigger.Binding = binding;
rowSelectedTrigger.Value = true;
var dynamicResource = new DynamicResourceExtension("DataGridRowSelectedForegroundThemeBrush");
rowSelectedTrigger.Setters.Add(new Setter(Button.ForegroundProperty, dynamicResource));
buttonStyle.Triggers.Add(rowSelectedTrigger);
}

public void GenerateColumns(bool withEntryColumn)
Expand Down Expand Up @@ -56,6 +76,11 @@ public void GenerateColumns(bool withEntryColumn)
buttonFactory.SetBinding(Button.TagProperty, new Binding($"Data.Properties[{i}]"));
// buttonFactory.SetBinding( Button.DataContextProperty, new Binding($"Data.Properties[{0}]"));
buttonFactory.SetValue(Button.HorizontalContentAlignmentProperty, HorizontalAlignment.Left);
buttonFactory.SetValue(Button.HorizontalAlignmentProperty, HorizontalAlignment.Stretch);
buttonFactory.SetValue(Button.BackgroundProperty, transparentBrush);

if(buttonStyle != null)
buttonFactory.SetValue(Button.StyleProperty, buttonStyle);
assetDataGrid.Columns.Add(new DataGridTemplateColumn
{
Header = properties[i].Name,
Expand Down
9 changes: 9 additions & 0 deletions FF7RebirthEditor.sln
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.13.35806.99 d17.13
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FF7RebirthDataObjectEditor", "FF7RebirthDataObjectEditor\FF7RebirthDataObjectEditor.csproj", "{670BBE4B-A355-4C49-AEA8-4D7E55848EFE}"
EndProject
Global
Expand All @@ -13,4 +16,10 @@ Global
{670BBE4B-A355-4C49-AEA8-4D7E55848EFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{670BBE4B-A355-4C49-AEA8-4D7E55848EFE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {46CE70B1-5FBB-4391-8CFC-BD54F5656B4B}
EndGlobalSection
EndGlobal