123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290 |
- using CollaborativePlatformMain.DFEntity;
- using CollaborativePlatformMain.Form.UserControlForm;
- using CollaborativePlatformMain.Util;
- using HandyControl.Controls;
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Diagnostics.Eventing.Reader;
- using System.Drawing.Printing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Shapes;
- using Window = System.Windows.Window;
- using MessageBox = System.Windows.MessageBox;
- using static System.Net.Mime.MediaTypeNames;
- using CollaborativePlatformMain.Form.MessageSubPage;
- using CollaborativePlatformMain.Form.MessageSubPage.CreatLevel;
- using CollaborativePlatformMain.Form.MessageSubPage.Project;
- using CollaborativePlatformMain.DFEntity.MessageSubUtil;
- namespace CollaborativePlatformMain.Form
- {
- /// <summary>
- /// HomepageForm.xaml 的交互逻辑
- /// </summary>
- public partial class HomepageForm : Window
- {
- public HomepageForm()
- {
- InitializeComponent();
- }
- #region 最左边消息
- /// <summary>
- /// 消息是否为初始化
- /// </summary>
- public bool IsSeconMessagePage = false;
- /// <summary>
- /// 消息窗体
- /// </summary>
- public SeconMessagePage SeconMessagePage = null;
- /// <summary>
- /// 消息
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void message_Click(object sender, MouseButtonEventArgs e)
- {
- MenuItem menuItem = sender as MenuItem;
- ModifyBackground(menuItem);
- dp_message.Visibility = Visibility.Visible;
- dp_project.Visibility = Visibility.Collapsed;
- dp_contacts.Visibility = Visibility.Collapsed;
- dp_gallery.Visibility = Visibility.Collapsed;
- dp_tools.Visibility = Visibility.Collapsed;
- dp_threetools.Visibility = Visibility.Collapsed;
- dp_ArticleReview.Visibility = Visibility.Collapsed;
- SeconMessagePage = new SeconMessagePage(this);
- seconMessagePage.Navigate(SeconMessagePage);
- IsSeconMessagePage = true;
- //SwitchMethod(sender as MenuItem, true);
- }
- /// <summary>
- /// 项目是否初始化
- /// </summary>
- public bool IsSeconProjectPageShow = false;
- /// <summary>
- /// 项目
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void project_Click(object sender, MouseButtonEventArgs e)
- {
- MenuItem menuItem = sender as MenuItem;
- ModifyBackground(menuItem);
- dp_message.Visibility = Visibility.Collapsed;
- dp_project.Visibility = Visibility.Visible;
- dp_contacts.Visibility = Visibility.Collapsed;
- dp_gallery.Visibility = Visibility.Collapsed;
- dp_tools.Visibility = Visibility.Collapsed;
- dp_threetools.Visibility = Visibility.Collapsed;
- dp_ArticleReview.Visibility = Visibility.Collapsed;
- if (!IsSeconProjectPageShow)
- {
- seconProjectPage.Navigate(new SeconProjectPage(this));
- IsSeconProjectPageShow = true;
- }
- }
- /// <summary>
- /// 联系人是否初始化
- /// </summary>
- public bool IsSeconContactsPage = false;
- /// <summary>
- /// 联系人
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void contacts_Click(object sender, MouseButtonEventArgs e)
- {
- MenuItem menuItem = sender as MenuItem;
- ModifyBackground(menuItem);
- dp_message.Visibility = Visibility.Collapsed;
- dp_project.Visibility = Visibility.Collapsed;
- dp_contacts.Visibility = Visibility.Visible;
- dp_gallery.Visibility = Visibility.Visible;
- dp_tools.Visibility = Visibility.Collapsed;
- dp_threetools.Visibility = Visibility.Collapsed;
- dp_ArticleReview.Visibility = Visibility.Collapsed;
- if (!IsSeconContactsPage)
- {
- seconContactsPage.Navigate(new SeconContactsPage(this));
- IsSeconContactsPage = true;
- }
- }
- /// <summary>
- /// 图库大样图是否初始化
- /// </summary>
- public bool IsSeconLegendPage = false;
- /// <summary>
- /// 图库大样图
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void gallery_Click(object sender, MouseButtonEventArgs e)
- {
- MenuItem menuItem = sender as MenuItem;
- ModifyBackground(menuItem);
- dp_message.Visibility = Visibility.Collapsed;
- dp_project.Visibility = Visibility.Collapsed;
- dp_contacts.Visibility = Visibility.Collapsed;
- dp_gallery.Visibility = Visibility.Visible;
- dp_tools.Visibility = Visibility.Collapsed;
- dp_threetools.Visibility = Visibility.Collapsed;
- dp_ArticleReview.Visibility = Visibility.Collapsed;
- if (!IsSeconLegendPage)
- {
- seconLegendPage.Navigate(new SeconLegendPage(this));
- IsSeconLegendPage = true;
- }
- }
- /// <summary>
- /// 工具库是否初始化
- /// </summary>
- public bool IsSeconToolLibraryPage = false;
- /// <summary>
- /// 工具库
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void tool_Click(object sender, MouseButtonEventArgs e)
- {
- MenuItem menuItem = sender as MenuItem;
- ModifyBackground(menuItem);
- dp_message.Visibility = Visibility.Collapsed;
- dp_project.Visibility = Visibility.Collapsed;
- dp_contacts.Visibility = Visibility.Collapsed;
- dp_gallery.Visibility = Visibility.Collapsed;
- dp_tools.Visibility = Visibility.Visible;
- dp_threetools.Visibility = Visibility.Collapsed;
- dp_ArticleReview.Visibility = Visibility.Collapsed;
- if (!IsSeconToolLibraryPage)
- {
- seconToolsPage.Navigate(new SeconToolLibraryPage());
- IsSeconToolLibraryPage = true;
- }
- }
- /// <summary>
- /// 三维是否初始化
- /// </summary>
- public bool IsSeconThreeDimensionalPage = false;
- /// <summary>
- /// 三维
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void three_Click(object sender, MouseButtonEventArgs e)
- {
- MenuItem menuItem = sender as MenuItem;
- ModifyBackground(menuItem);
- dp_message.Visibility = Visibility.Collapsed;
- dp_project.Visibility = Visibility.Collapsed;
- dp_contacts.Visibility = Visibility.Collapsed;
- dp_gallery.Visibility = Visibility.Collapsed;
- dp_tools.Visibility = Visibility.Collapsed;
- dp_threetools.Visibility = Visibility.Visible;
- dp_ArticleReview.Visibility = Visibility.Collapsed;
- if (!IsSeconThreeDimensionalPage)
- {
- seconThreeTools.Navigate(new SeconThreeDimensionalPage(this));
- IsSeconThreeDimensionalPage = true;
- }
- }
- /// <summary>
- /// 条文审查是否初始化
- /// </summary>
- public bool IsSeconArticleReviewPage = false;
- /// <summary>
- /// 条文审查
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void MenuItem_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
- {
- MenuItem menuItem = sender as MenuItem;
- ModifyBackground(menuItem);
- dp_message.Visibility = Visibility.Collapsed;
- dp_project.Visibility = Visibility.Collapsed;
- dp_contacts.Visibility = Visibility.Collapsed;
- dp_gallery.Visibility = Visibility.Collapsed;
- dp_tools.Visibility = Visibility.Collapsed;
- dp_threetools.Visibility = Visibility.Collapsed;
- dp_ArticleReview.Visibility = Visibility.Visible;
- if (!IsSeconArticleReviewPage)
- {
- seconArticleReview.Navigate(new SeconArticleReviewPage());
- IsSeconArticleReviewPage = true;
- }
- }
- /// <summary>
- /// 设置最左测导航的颜色
- /// </summary>
- /// <param name="menuItem"></param>
- /// <param name="isHoShow"></param>
- public void ModifyBackground(MenuItem menuItem)
- {
- List<MenuItem> allMenuItems = CollaborationUtil.GetChildObjects<System.Windows.Controls.MenuItem>(mu_leftMenu);
- foreach (var baseMenuItem in allMenuItems)
- {
- if (baseMenuItem.Header.ToString() == menuItem.Header.ToString())
- {
- baseMenuItem.Background = new SolidColorBrush(Colors.Beige);
- }
- else
- {
- baseMenuItem.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#1E9FFF"));
- }
- }
- }
- #endregion
- /// <summary>
- /// 青蓝小助手
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void bt_qlxzs_Click(object sender, RoutedEventArgs e)
- {
- this.Visibility = Visibility.Collapsed;
- StandardizedAssistantForm assistantForm = new StandardizedAssistantForm(this);
- assistantForm.Show();
- }
-
- }
- }
|