mirror of https://github.com/icsharpcode/ILSpy.git
7 changed files with 108 additions and 24 deletions
@ -0,0 +1,49 @@
@@ -0,0 +1,49 @@
|
||||
// Copyright (c) 2026 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System.Linq; |
||||
|
||||
using Avalonia.Controls; |
||||
using Avalonia.Headless.NUnit; |
||||
|
||||
using AwesomeAssertions; |
||||
|
||||
using ILSpy; |
||||
|
||||
using NUnit.Framework; |
||||
|
||||
namespace ICSharpCode.ILSpy.Tests; |
||||
|
||||
// MainMenu's top-level structure (File / View / Window with mnemonic underscores) is the
|
||||
// scaffolding every later commit hangs items onto via MEF. If a future commit accidentally
|
||||
// drops one of these top-levels or shuffles the order, the [ExportMainMenuCommand] entries
|
||||
// that target them by header would silently land in the wrong menu.
|
||||
[TestFixture] |
||||
public class MainMenuTests |
||||
{ |
||||
[AvaloniaTest] |
||||
public void MainMenu_top_level_items_are_File_View_Window_in_order() |
||||
{ |
||||
var mainMenu = new MainMenu(); |
||||
var menu = mainMenu.FindControl<Menu>("Menu"); |
||||
menu.Should().NotBeNull(); |
||||
|
||||
var headers = menu!.Items.OfType<MenuItem>().Select(m => m.Header as string).ToList(); |
||||
headers.Should().Equal("_File", "_View", "_Window"); |
||||
} |
||||
} |
||||
@ -1,24 +1,36 @@
@@ -1,24 +1,36 @@
|
||||
<Window xmlns="https://github.com/avaloniaui" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
xmlns:vm="using:ILSpy.ViewModels" |
||||
xmlns:local="using:ILSpy" |
||||
xmlns:local="using:ILSpy" |
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" |
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="500" |
||||
x:Class="ILSpy.Views.MainWindow" |
||||
x:DataType="vm:MainWindowViewModel" |
||||
Icon="/Assets/ILSpy.ico" |
||||
Title="ILSpy"> |
||||
MinWidth="250" MinHeight="200" |
||||
UseLayoutRounding="True" |
||||
Title="{Binding Title}"> |
||||
|
||||
<Design.DataContext> |
||||
<!-- This only sets the DataContext for the previewer in an IDE, |
||||
to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) --> |
||||
<vm:MainWindowViewModel/> |
||||
</Design.DataContext> |
||||
<Design.DataContext> |
||||
<vm:MainWindowViewModel /> |
||||
</Design.DataContext> |
||||
|
||||
<DockPanel> |
||||
<!-- Main menu --> |
||||
<local:MainMenu DockPanel.Dock="Top" /> |
||||
|
||||
</DockPanel> |
||||
<!-- Status bar (hidden by default, like WPF) --> |
||||
<Border DockPanel.Dock="Bottom" Height="26" IsVisible="False" Name="statusBar"> |
||||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" |
||||
Margin="8,0" Name="statusLabel" Text="Stand by..." /> |
||||
</Border> |
||||
|
||||
<!-- Placeholder for DockingManager (task #4: replace with Dock.Avalonia) --> |
||||
<ContentControl Name="DockHost"> |
||||
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" |
||||
Foreground="Gray" FontStyle="Italic" |
||||
Text="Docking workspace will appear here." /> |
||||
</ContentControl> |
||||
</DockPanel> |
||||
</Window> |
||||
|
||||
Loading…
Reference in new issue