/*
  * 四、编辑控件后 - 更新到页面
  */
 public void updateElement(DControl ctl, bool isDesign)
 {
     currDControl            = ctl;
     textBlock.FontSize      = FontUtil.getFontSize(currDControl.fontSize);
     textBlock.FontFamily    = FontUtil.getFontFamily(currDControl.fontFamily);
     textBlock.Foreground    = FontUtil.getFontColor(currDControl.fontColor);
     textBlock.FontWeight    = FontUtil.getFontWeight(currDControl.fontWeight);
     textBlock.TextAlignment = FontUtil.getFontTextAlignment(currDControl.fontTextAlignment);
     TextBlock.SetLineHeight(textBlock, FontUtil.getFontLineHeight(currDControl.fontLineHeight));
     updateContent(currDControl.content);
 }
        /*
         * 初始化定时器
         */
        private void init()
        {
            textBlock.FontSize      = FontUtil.getFontSize(currDControl.fontSize);
            textBlock.FontFamily    = FontUtil.getFontFamily(currDControl.fontFamily);
            textBlock.Foreground    = FontUtil.getFontColor(currDControl.fontColor);
            textBlock.FontWeight    = FontUtil.getFontWeight(currDControl.fontWeight);
            textBlock.TextAlignment = FontUtil.getFontTextAlignment(currDControl.fontTextAlignment);
            TextBlock.SetLineHeight(textBlock, FontUtil.getFontLineHeight(currDControl.fontLineHeight));
            updateContent(currDControl.content);

            timer.Tick += new EventHandler(Timer_Tick); //超过计时间隔时发生
            timer.Start();                              //DT启动
        }
Example #3
0
        private void This_Close(object sender, EventArgs e)
        {
            //同步到页面
            currElement.Tag = currDControl;
            TextBox textBox = (TextBox)currElement;

            textBox.Text = content.Text;

            textBox.FontSize      = FontUtil.getFontSize(currDControl.fontSize);
            textBox.FontFamily    = FontUtil.getFontFamily(currDControl.fontFamily);
            textBox.Foreground    = FontUtil.getFontColor(currDControl.fontColor);
            textBox.FontWeight    = FontUtil.getFontWeight(currDControl.fontWeight);
            textBox.TextAlignment = FontUtil.getFontTextAlignment(currDControl.fontTextAlignment);

            TextBlock.SetLineHeight(textBox, FontUtil.getFontLineHeight(currDControl.fontLineHeight));
        }
Example #4
0
        private void fontFamily_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ComboBox cbb = (ComboBox)sender;
            object   obj = cbb.SelectedValue;

            if (obj == null)
            {
                return;
            }

            ComboBoxItem cbi            = (ComboBoxItem)obj;
            string       fontFamilyText = cbi.Content.ToString();
            string       fontFamilyVal  = fontFamilyText;


            TextBox textBox = (TextBox)currElement;

            textBox.Text       = content.Text;
            textBox.FontFamily = FontUtil.getFontFamily(fontFamilyVal);
        }
 public void updateFontFamilyVal(string text, string fontFamilyVal)
 {
     textBlock.FontFamily = FontUtil.getFontFamily(fontFamilyVal);
     currDControl.content = text;
     updateContent(text);
 }