Add AbnormalStyle.Underline; use toggle buttons.
This commit is contained in:
		@@ -36,7 +36,10 @@ namespace zaaReloaded2.Formatter
 | 
			
		||||
        Bold = 0x01,
 | 
			
		||||
 | 
			
		||||
        [Description("Kursiv")]
 | 
			
		||||
        Italics = 0x02
 | 
			
		||||
        Italics = 0x02,
 | 
			
		||||
 | 
			
		||||
        [Description("Unterstrichen")]
 | 
			
		||||
        Underline = 0x04
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static class AbnormalStyleExtensions
 | 
			
		||||
@@ -56,6 +59,8 @@ namespace zaaReloaded2.Formatter
 | 
			
		||||
                markup += String.Format("<{0}b>", dash);
 | 
			
		||||
            if (style.HasFlag(AbnormalStyle.Italics))
 | 
			
		||||
                markup += String.Format("<{0}i>", dash);
 | 
			
		||||
            if (style.HasFlag(AbnormalStyle.Underline))
 | 
			
		||||
                markup += String.Format("<{0}u>", dash);
 | 
			
		||||
            return markup;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -208,6 +208,12 @@ namespace zaaReloaded2.Formatter
 | 
			
		||||
                    case "</i>":
 | 
			
		||||
                        sel.Font.Italic = 0;
 | 
			
		||||
                        break;
 | 
			
		||||
                    case "<u>":
 | 
			
		||||
                        sel.Font.Underline = WdUnderline.wdUnderlineSingle;
 | 
			
		||||
                        break;
 | 
			
		||||
                    case "</u>":
 | 
			
		||||
                        sel.Font.Underline = WdUnderline.wdUnderlineNone;
 | 
			
		||||
                        break;
 | 
			
		||||
                    case "</style>":
 | 
			
		||||
                        sel.ClearCharacterStyle();
 | 
			
		||||
                        break;
 | 
			
		||||
 
 | 
			
		||||
@@ -162,6 +162,29 @@ namespace zaaReloaded2.ViewModels
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// Gets or sets whether abnormal values shall be underlined.
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public bool AbnormalUnderline
 | 
			
		||||
        {
 | 
			
		||||
            get
 | 
			
		||||
            {
 | 
			
		||||
                return _settings.AbnormalStyle.HasFlag(AbnormalStyle.Underline);
 | 
			
		||||
            }
 | 
			
		||||
            set
 | 
			
		||||
            {
 | 
			
		||||
                if (value)
 | 
			
		||||
                {
 | 
			
		||||
                    _settings.AbnormalStyle |= AbnormalStyle.Underline;
 | 
			
		||||
                }
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
                    _settings.AbnormalStyle &= ~AbnormalStyle.Underline;
 | 
			
		||||
                }
 | 
			
		||||
                OnPropertyChanged("AbnormalUnderline");
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        #endregion
 | 
			
		||||
 | 
			
		||||
        #region Constructors
 | 
			
		||||
 
 | 
			
		||||
@@ -60,12 +60,19 @@
 | 
			
		||||
                      SelectedItem="{Binding ReferenceStyle.SelectedItem}"
 | 
			
		||||
                      x:Name="ReferenceStyleChooser" HorizontalAlignment="Stretch" />
 | 
			
		||||
        </DockPanel>
 | 
			
		||||
        <DockPanel DockPanel.Dock="Top">
 | 
			
		||||
        <DockPanel DockPanel.Dock="Top" Margin="0 10 0 0">
 | 
			
		||||
            <Label DockPanel.Dock="Left" Content="Auszeichnung pathologischer Werte:" Margin="0 0 10 0"
 | 
			
		||||
                   Target="{Binding ElementName=AbnormalStyleChooser}" />
 | 
			
		||||
            <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
 | 
			
		||||
                <CheckBox IsChecked="{Binding AbnormalBold}" Content="Fett" />
 | 
			
		||||
                <CheckBox IsChecked="{Binding AbnormalItalics}" Content="Kursiv" Margin="10 0 0 0" />
 | 
			
		||||
                <ToggleButton IsChecked="{Binding AbnormalBold}" Height="25" Width="25">
 | 
			
		||||
                    <TextBlock FontWeight="Black">F</TextBlock>
 | 
			
		||||
                </ToggleButton>
 | 
			
		||||
                <ToggleButton IsChecked="{Binding AbnormalItalics}" Height="25" Width="25">
 | 
			
		||||
                    <TextBlock FontStyle="Italic">K</TextBlock>
 | 
			
		||||
                </ToggleButton>
 | 
			
		||||
                <ToggleButton IsChecked="{Binding AbnormalUnderline}" Height="25" Width="25">
 | 
			
		||||
                    <TextBlock TextDecorations="Underline">U</TextBlock>
 | 
			
		||||
                </ToggleButton>
 | 
			
		||||
            </StackPanel>
 | 
			
		||||
        </DockPanel>
 | 
			
		||||
        <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right">
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user