MainWindow.xaml.cs
(开头部分) 27KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Media;
using XStart.Bean;
using XStart.Config;
using XStart.Const;
using XStart.Services;
using XStart.Utils;
using XStart2._0.Helper;
using XStart2._0.Utils;
using XStart2._0.ViewModels;
using XStart2._0.Windows;
namespace XStart2._0 {
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
public partial class MainWindow : Window {
public TypeService typeService = TypeService.Instance;
public ColumnService columnService = ColumnService.Instance;
public ProjectService projectService = ProjectService.Instance;
MainViewModel mainViewModel = new MainViewModel();
public MainWindow() {
InitializeComponent();
Configs.Handler = new System.Windows.Interop.WindowInteropHelper(this).Handle;
DataContext = mainViewModel;
}
private void Window_Close(object sender, RoutedEventArgs e) {
Close();
}
/// <summary>
/// 栏目面板展开事件,该栏目对应的类别中,其他展开的栏目收缩
/// 1.收缩时,将IsExpanded置为fase,以及高度置为0
/// 2.当前栏目高度置为展开的高度
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Expander_Expanded_Handler(object sender, RoutedEventArgs e) {
Expander curExpander = sender as Expander;
string columnSection = curExpander.GetValue(ElementParamHelper.ColumnSectionProperty) as string;
string typeSection = curExpander.GetValue(ElementParamHelper.TypeSectionProperty) as string;
ExpandColumn(typeSection, columnSection);
}
/// <summary>
/// 展开栏目
/// </summary>
/// <param name="typeSection">类别Section</param>
/// <param name="columnSection">栏目Section</param>
private void ExpandColumn(string typeSection, string columnSection) {
XStart.Bean.Type type = XStartService.TypeDic[typeSection];
foreach (Column c in type.ColumnDic.Values) {
if (!columnSection.Equals(c.Section) && c.IsExpanded) {
c.IsExpanded = false;
后面还有 502 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
