DragAndDrop core
This commit is contained in:
64
Lattice.IDE/MainWindow.xaml.cs
Normal file
64
Lattice.IDE/MainWindow.xaml.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
using Lattice.Core.Docking.Engine;
|
||||
using Lattice.Core.Docking.Models;
|
||||
using Lattice.IDE.Controls;
|
||||
using Lattice.Themes;
|
||||
using Microsoft.UI.Xaml;
|
||||
// Ïðåäïîëîæèì, ÷òî VS2026Theme òîæå ðåàëèçîâàí àíàëîãè÷íî Fluent
|
||||
// using Lattice.Themes.VisualStudio2026;
|
||||
|
||||
namespace Lattice.IDE;
|
||||
|
||||
public sealed partial class MainWindow : Window
|
||||
{
|
||||
private LayoutManager _manager;
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
WindowTracker.Register(this);
|
||||
SystemBackdrop = new Microsoft.UI.Xaml.Media.MicaBackdrop();
|
||||
InitLattice();
|
||||
}
|
||||
|
||||
private void InitLattice()
|
||||
{
|
||||
_manager = new LayoutManager();
|
||||
|
||||
// Ñîçäàåì êîíòåíò íà îñíîâå XAML UserControls
|
||||
var solutionExplorer = new DemoContent(
|
||||
"sln",
|
||||
"Solution Explorer",
|
||||
new SolutionExplorerView()
|
||||
);
|
||||
|
||||
var editor = new DemoContent(
|
||||
"code_01",
|
||||
"Program.cs",
|
||||
new EditorView()
|
||||
);
|
||||
|
||||
// Ñîáèðàåì äåðåâî (êàê ðàíüøå)
|
||||
var leftLeaf = new DockLeaf();
|
||||
leftLeaf.AddContent(solutionExplorer);
|
||||
|
||||
var centerLeaf = new DockLeaf()
|
||||
{
|
||||
TabPlacement = TabPlacement.Top,
|
||||
};
|
||||
centerLeaf.AddContent(editor);
|
||||
|
||||
var rootGroup = new DockGroup(leftLeaf, centerLeaf, SplitDirection.Horizontal)
|
||||
{
|
||||
SplitRatio = 0.25
|
||||
};
|
||||
|
||||
_manager.SetRoot(rootGroup);
|
||||
DockHost.Manager = _manager;
|
||||
}
|
||||
|
||||
private void SetFluentTheme(object sender, RoutedEventArgs e) =>
|
||||
ThemeManager.Current.ApplyTheme(new FluentThemePack());
|
||||
|
||||
private void SetVSTheme(object sender, RoutedEventArgs e) =>
|
||||
ThemeManager.Current.ApplyTheme(new VS2026ThemePack());
|
||||
}
|
||||
Reference in New Issue
Block a user