添加项目文件。
This commit is contained in:
30
GroupLine.App/View/UserControlMenuItem.xaml.cs
Normal file
30
GroupLine.App/View/UserControlMenuItem.xaml.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user