mirror of
				https://github.com/holgerb83/ModernWpfPlayground.git
				synced 2025-10-31 00:11:19 +01:00 
			
		
		
		
	Compare commits
	
		
			2 Commits
		
	
	
		
			b1e70f09b1
			...
			8c87abeb1d
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 8c87abeb1d | |||
| 45370afa95 | 
| @@ -4,6 +4,7 @@ | ||||
|     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||||
|     xmlns:controls="http://wpflib.de/" | ||||
|     xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||||
|     xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" | ||||
|     xmlns:local="clr-namespace:ModernWpfPlayground" | ||||
|     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||||
|     xmlns:prism="http://prismlibrary.com/" | ||||
| @@ -82,30 +83,34 @@ | ||||
|                     <MenuItem | ||||
|                         Command="{Binding ResetViewModelCommand}" | ||||
|                         Header="New" | ||||
|                         Icon="{iconPacks:FontAwesome Kind=FileRegular}" | ||||
|                         InputGestureText="Ctrl+N" /> | ||||
|                     <MenuItem | ||||
|                         Command="{Binding OpenViewModelCommand}" | ||||
|                         Header="Open" | ||||
|                         Icon="{iconPacks:FontAwesome Kind=FolderOpenRegular}" | ||||
|                         InputGestureText="Ctrl+O" /> | ||||
|                     <MenuItem | ||||
|                         Command="{Binding SaveViewModelCommand}" | ||||
|                         Header="Save" | ||||
|                         Icon="{iconPacks:FontAwesome Kind=SaveRegular}" | ||||
|                         InputGestureText="Ctrl+S" /> | ||||
|                     <Separator /> | ||||
|                     <MenuItem | ||||
|                         Command="{Binding CloseCommand}" | ||||
|                         Header="Close" | ||||
|                         Icon="{iconPacks:FontAwesome Kind=WindowCloseRegular}" | ||||
|                         InputGestureText="Alt+F4" /> | ||||
|                 </MenuItem> | ||||
|                 <MenuItem Header="Edit"> | ||||
|                     <MenuItem Header="Copy" /> | ||||
|                     <MenuItem Header="Cut" /> | ||||
|                     <MenuItem Header="Paste" /> | ||||
|                     <MenuItem Header="Copy" Icon="{iconPacks:FontAwesome Kind=CopyRegular}" /> | ||||
|                     <MenuItem Header="Cut" Icon="{iconPacks:FontAwesome Kind=CutSolid}" /> | ||||
|                     <MenuItem Header="Paste" Icon="{iconPacks:FontAwesome Kind=ClipboardRegular}" /> | ||||
|                 </MenuItem> | ||||
|                 <MenuItem Header="Help"> | ||||
|                     <MenuItem Header="?" /> | ||||
|                     <MenuItem Header="?" Icon="{iconPacks:FontAwesome Kind=QuestionCircleRegular}" /> | ||||
|                     <Separator /> | ||||
|                     <MenuItem Header="Info" /> | ||||
|                     <MenuItem Header="Info" Icon="{iconPacks:FontAwesome Kind=InfoSolid}" /> | ||||
|                 </MenuItem> | ||||
|             </Menu> | ||||
|             <!--  Horizontally centered title  --> | ||||
|   | ||||
| @@ -14,6 +14,7 @@ | ||||
|     <PackageReference Include="Prism.Wpf" Version="8.0.0.1740-pre" /> | ||||
|     <PackageReference Include="YamlDotNet" Version="8.1.2" /> | ||||
|     <PackageReference Include="System.Drawing.Common" Version="4.7.0" /> | ||||
|     <PackageReference Include="MahApps.Metro.IconPacks.FontAwesome" Version="4.3.0" /> | ||||
|   </ItemGroup> | ||||
|  | ||||
|   <ItemGroup> | ||||
|   | ||||
| @@ -7,6 +7,7 @@ using System.Windows.Controls; | ||||
| using System.Windows.Data; | ||||
| using System.Windows.Documents; | ||||
| using System.Windows.Media; | ||||
|  | ||||
| namespace Controls | ||||
| { | ||||
|     /// <summary> | ||||
| @@ -73,7 +74,7 @@ namespace Controls | ||||
|             var block = new TextBlock(); | ||||
|             foreach (var tc in textComponents) | ||||
|             { | ||||
|                 var run = new Run(tc.Text) { FontFamily = new FontFamily("Palatino Linotype"), FontSize = 16 }; | ||||
|                 var run = new Run(tc.Text) {FontFamily = new FontFamily("Palatino Linotype"), FontSize = 16}; | ||||
|                 switch (tc.Style) | ||||
|                 { | ||||
|                     case BaselineAlignment.Subscript: | ||||
| @@ -85,8 +86,10 @@ namespace Controls | ||||
|                         run.FontSize = 12; | ||||
|                         break; | ||||
|                 } | ||||
|  | ||||
|                 block.Inlines.Add(run); | ||||
|             } | ||||
|  | ||||
|             block.HorizontalAlignment = HorizontalAlignment.Right; | ||||
|             block.VerticalAlignment = VerticalAlignment.Center; | ||||
|             return block; | ||||
| @@ -109,7 +112,10 @@ namespace Controls | ||||
|                             textComponents.Add(comp); | ||||
|                             snippet.Clear(); | ||||
|                         } | ||||
|                         alignment = alignment == BaselineAlignment.Subscript ? BaselineAlignment.Baseline : BaselineAlignment.Subscript; | ||||
|  | ||||
|                         alignment = alignment == BaselineAlignment.Subscript | ||||
|                             ? BaselineAlignment.Baseline | ||||
|                             : BaselineAlignment.Subscript; | ||||
|                         break; | ||||
|                     case '^': | ||||
|                         if (snippet.Length > 0) | ||||
| @@ -118,13 +124,17 @@ namespace Controls | ||||
|                             textComponents.Add(comp); | ||||
|                             snippet.Clear(); | ||||
|                         } | ||||
|                         alignment = alignment == BaselineAlignment.Superscript ? BaselineAlignment.Baseline : BaselineAlignment.Superscript; | ||||
|  | ||||
|                         alignment = alignment == BaselineAlignment.Superscript | ||||
|                             ? BaselineAlignment.Baseline | ||||
|                             : BaselineAlignment.Superscript; | ||||
|                         break; | ||||
|                     default: | ||||
|                         snippet.Append(c); | ||||
|                         break; | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             if (snippet.Length > 0) | ||||
|             { | ||||
|                 var comp = new TextComponent(snippet.ToString(), alignment); | ||||
|   | ||||
| @@ -89,10 +89,11 @@ | ||||
|         <controls:EnumToKeyValueListConverter x:Key="EnumToKeyValuePairConverter" /> | ||||
|         <DataTemplate x:Key="EnumComboBoxDataTemplate"> | ||||
|             <ComboBox | ||||
|                 HorizontalAlignment="Stretch" | ||||
|                 DisplayMemberPath="Key" | ||||
|                 ItemsSource="{Binding Value, ElementName=LayoutRoot, Converter={StaticResource EnumToKeyValuePairConverter}}" | ||||
|                 SelectedValue="{Binding Value, ElementName=LayoutRoot}" | ||||
|                 SelectedValuePath="Value" HorizontalAlignment="Stretch" | ||||
|                 SelectedValuePath="Value" | ||||
|                 Validation.ErrorTemplate="{DynamicResource ValidationErrorTemplate}" | ||||
|                 Validation.ValidationAdornerSiteFor="{Binding ElementName=LayoutRoot}"> | ||||
|                 <ComboBox.Style> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user