Ejemplo n.º 1
0
        /// <summary>
        /// 语言菜单单击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void LanguageItem_Click(object sender, RoutedEventArgs e)
        {
            MenuItem item = sender as MenuItem;

            ChangeLanguage(item.Tag.ToString());
            MenuItem LanItem = null;

            for (int i = 0; i < ButtonApplicationMenu.ContextMenu.Items.Count; i++)
            {
                LanItem = ButtonApplicationMenu.ContextMenu.Items[i] as MenuItem;
                if (LanItem.IsChecked)
                {
                    LanItem.IsChecked = false;
                }
            }
            item.IsChecked   = true;
            App.gStrCurrLang = item.Tag.ToString();

            //如果是许可协议界面,把许可协议切换语言
            try
            {
                UC_License uc_License = borderUpdater.Child as UC_License;
                uc_License.GetLicenseContent();
            }
            catch
            {
            }

            //如果是更新内容界面 把更新内容切换语言
            try
            {
                UC_UpdateContent uc_Content = borderUpdater.Child as UC_UpdateContent;
                uc_Content.InitUpdateContent();
            }
            catch
            {
            }
        }
Ejemplo n.º 2
0
        void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            LabelApplicationTitle.Content = "UMP Service Pack " + App.updateInfo.Version;
            SetBusy(true);
            DrawingBackground.DrawWindowsBackgond(this);
            InitLanguage();
            UC_UpdateContent uc_UpdateContent = new UC_UpdateContent();

            borderUpdater.Child   = uc_UpdateContent;
            uc_UpdateContent.main = this;
            InitLanguageMenu();

            #region 绑定事件

            MouseLeftButtonDown         += (s, be) => DragMove();
            ButtonApplicationMenu.Click += ButtonApplicationMenu_Click;
            ButtonCloseApp.Click        += ButtonCloseApp_Click;
            ButtonMinimized.Click       += ButtonMinimized_Click;
            ButtonMaximized.Click       += ButtonMaximized_Click;
            #endregion

            ChangeLanguage(App.gStrCurrLang);
        }