private void FontButton_Click_1(object sender, RoutedEventArgs e)
        {
            var dlg = new emanual.Wpf.Controls.FontDialogEx();
            CommonLightBox lightBox = new CommonLightBox();
            lightBox.LightBoxKind = CommonLightBox.CommonLightBoxKind.SaveCancel;
            lightBox.BindUIElement(dlg);
            lightBox.Owner = Application.Current.MainWindow;

            dlg.DlgFontFamily = Properties.Settings.Default.TextBoxFontFamily;
            //dlg.DlgFontWeight = FontWeights.Bold;
            dlg.DlgFontSize = Properties.Settings.Default.TextBoxFontSize;
            dlg.DlgLanguage = "ja-jp";
            dlg.DlgSampleText = "ここでFontのテストが出来ます";

            if (ShowDialogManager.ShowDialog(lightBox) == true)
            {
                Properties.Settings.Default.TextBoxFontSize = dlg.DlgFontSize;
                Properties.Settings.Default.TextBoxFontFamily = dlg.DlgFontFamily;
                Properties.Settings.Default.Save();

                EventAggregator.OnFontSettingChanged(this, 0);
            }
        }
        private void FontButton_Click_1(object sender, RoutedEventArgs e)
        {
            var            dlg      = new emanual.Wpf.Controls.FontDialogEx();
            CommonLightBox lightBox = new CommonLightBox();

            lightBox.LightBoxKind = CommonLightBox.CommonLightBoxKind.SaveCancel;
            lightBox.BindUIElement(dlg);
            lightBox.Owner = Application.Current.MainWindow;

            dlg.DlgFontFamily = Properties.Settings.Default.TextBoxFontFamily;
            //dlg.DlgFontWeight = FontWeights.Bold;
            dlg.DlgFontSize   = Properties.Settings.Default.TextBoxFontSize;
            dlg.DlgLanguage   = "ja-jp";
            dlg.DlgSampleText = "ここでFontのテストが出来ます";

            if (ShowDialogManager.ShowDialog(lightBox) == true)
            {
                Properties.Settings.Default.TextBoxFontSize   = dlg.DlgFontSize;
                Properties.Settings.Default.TextBoxFontFamily = dlg.DlgFontFamily;
                Properties.Settings.Default.Save();

                EventAggregator.OnFontSettingChanged(this, 0);
            }
        }
示例#3
0
        //-----------------------------------------------------------------------------------
        //フォントダイアログの表示
        private void Menu_font_Click(object sender, RoutedEventArgs e)
        {
            var dlg = new emanual.Wpf.Controls.FontDialogEx
                {
                    Left = this.Left + 50,
                    Top = this.Top + 50,
                    DlgFontFamily = new FontFamily("メイリオ"),
                    DlgFontSize = 15,
                    DlgLanguage = "ja-jp",
                    DlgSampleText = "テスト Test"
                };

            //dlg.DlgFontWeight = FontWeights.Bold;

            if (dlg.ShowDialog() == true)
            {
                fst_textBox.FontFamily = dlg.DlgFontFamily;
                fst_textBox.FontSize = dlg.DlgFontSize;
                fst_textBox.FontWeight = dlg.DlgFontWeight;
                fst_textBox.FontStyle = dlg.DlgFontStyle;
            }
        }