31 lines
982 B
C#
31 lines
982 B
C#
using GroupLine.App.ViewModel;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
|
|
namespace GroupLine.App.View
|
|
{
|
|
/// <summary>
|
|
/// UserControlMenuItem.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class UserControlMenuItem : UserControl
|
|
{
|
|
MainWindow _context;
|
|
|
|
public UserControlMenuItem(ItemMenu itemMenu, MainWindow context)
|
|
{
|
|
InitializeComponent();
|
|
_context = context;
|
|
|
|
ExpanderMenu.Visibility = itemMenu.SubItems == null ? Visibility.Collapsed : Visibility.Visible;
|
|
ListViewItemMenu.Visibility = itemMenu.SubItems == null ? Visibility.Visible : Visibility.Collapsed;
|
|
|
|
this.DataContext = itemMenu;
|
|
}
|
|
private void ListViewMenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
{
|
|
_context.SwitchScreen(((SubItem)((ListView)sender).SelectedItem).Screen);
|
|
//ListViewMenu.SelectedIndex = -1;
|
|
}
|
|
}
|
|
}
|