Skip to content

Commit

Permalink
Removed references to MenuEntry in MenuViewModel.
Browse files Browse the repository at this point in the history
  • Loading branch information
syntax-tm committed Jul 11, 2024
1 parent cad015e commit e207aeb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
15 changes: 15 additions & 0 deletions src/SAM/Controls/MenuHeaderItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Windows;
using System.Windows.Media;
using Wpf.Ui.Controls;

namespace SAM.Controls;

public class MenuHeaderItem : MenuItem
{
static MenuHeaderItem()
{
IsEnabledProperty.OverrideMetadata(typeof(MenuHeaderItem), new FrameworkPropertyMetadata(false));
BorderBrushProperty.OverrideMetadata(typeof(MenuHeaderItem), new FrameworkPropertyMetadata(new SolidColorBrush(Colors.Transparent)));
BorderThicknessProperty.OverrideMetadata(typeof(MenuHeaderItem), new FrameworkPropertyMetadata(new Thickness(0)));
}
}
4 changes: 2 additions & 2 deletions src/SAM/Styles/Base/MenuHeaderItem.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
</Style.Triggers>
</Style>

<DataTemplate x:Key="MenuEntryDataTemplate" DataType="{x:Type sam:MenuEntry}">
<!--<DataTemplate x:Key="MenuEntryDataTemplate" DataType="{x:Type sam:MenuEntry}">
<ui:MenuItem Header="{Binding Header}"
ItemsSource="{Binding Items, Mode=OneWay}"
IsEnabled="{Binding Enabled}"
IsCheckable="{Binding Checkable}"
IsChecked="{Binding IsChecked, Mode=TwoWay}"
Style="{StaticResource DefaultMenuEntryStyle}">
</ui:MenuItem>
</DataTemplate>
</DataTemplate>-->

<Style TargetType="{x:Type controls:MenuHeaderItem}">
<Setter Property="IsEnabled" Value="False" />
Expand Down
6 changes: 0 additions & 6 deletions src/SAM/ViewModels/MenuViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ public partial class MenuViewModel
[GenerateProperty] private HomeViewModel _homeVm;
[GenerateProperty] private SteamGameViewModel _gameVm;
[GenerateProperty] private ApplicationMode _mode;
[GenerateProperty] private ObservableCollection<MenuEntry> _fileMenuItems;
[GenerateProperty] private ObservableCollection<MenuEntry> _editMenuItems;
[GenerateProperty] private ObservableCollection<MenuEntry> _viewMenuItems;
[GenerateProperty] private ObservableCollection<MenuEntry> _toolsMenuItems;
[GenerateProperty] private ObservableCollection<MenuEntry> _windowMenuItems;
[GenerateProperty] private ObservableCollection<MenuEntry> _helpMenuItems;

public bool IsLibrary => _mode == ApplicationMode.Default;
public bool IsManager => _mode == ApplicationMode.Manager;
Expand Down

0 comments on commit e207aeb

Please sign in to comment.