Skip to content

Commit

Permalink
fix one textblock style and add typography page
Browse files Browse the repository at this point in the history
  • Loading branch information
ButchersBoy committed Dec 8, 2015
1 parent 208de7d commit 72bc163
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 5 deletions.
7 changes: 7 additions & 0 deletions MainDemo.Wpf/MainDemo.Wpf.csproj
Expand Up @@ -138,6 +138,9 @@
<Compile Include="Trees.xaml.cs">
<DependentUpon>Trees.xaml</DependentUpon>
</Compile>
<Compile Include="Typography.xaml.cs">
<DependentUpon>Typography.xaml</DependentUpon>
</Compile>
<Page Include="Buttons.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -234,6 +237,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Typography.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Palette.xaml.cs">
Expand Down
9 changes: 7 additions & 2 deletions MainDemo.Wpf/MainWindow.xaml
Expand Up @@ -7,8 +7,8 @@
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
Title="Material Design in XAML" Height="800" Width="1100"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Medium"
TextElement.FontSize="14"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
Background="{DynamicResource MaterialDesignPaper}"
Expand Down Expand Up @@ -84,6 +84,11 @@
<wpfExample:Sliders />
</domain:DemoItem.Content>
</domain:DemoItem>
<domain:DemoItem Name="Typography">
<domain:DemoItem.Content>
<wpfExample:Typography />
</domain:DemoItem.Content>
</domain:DemoItem>
<domain:DemoItem Name="Cards">
<domain:DemoItem.Content>
<wpfExample:Cards />
Expand Down
69 changes: 69 additions & 0 deletions MainDemo.Wpf/Typography.xaml
@@ -0,0 +1,69 @@
<UserControl x:Class="MaterialDesignColors.WpfExample.Typography"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<UserControl.Resources>
<Style TargetType="TextBlock" BasedOn="{StaticResource MaterialDesignCaptionTextBlock}">
<Setter Property="Opacity" Value=".68"></Setter>
</Style>
</UserControl.Resources>

<Grid Margin="32">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="64" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Margin="0 26 0 0">Display 4 - MaterialDesignDisplay4TextBlock</TextBlock>
<TextBlock Grid.Row="0" Grid.Column="2" Style="{StaticResource MaterialDesignDisplay4TextBlock}" Margin="0 4 0 4">Light 112sp</TextBlock>

<TextBlock Grid.Row="1" Grid.Column="0" Margin="0 12 0 0">Display 3 - MaterialDesignDisplay3TextBlock</TextBlock>
<TextBlock Grid.Row="1" Grid.Column="2" Style="{StaticResource MaterialDesignDisplay3TextBlock}" Margin="0 4 0 4">Regular 56sp</TextBlock>

<TextBlock Grid.Row="2" Grid.Column="0" Margin="0 8 0 0">Display 2 - MaterialDesignDisplay2TextBlock</TextBlock>
<TextBlock Grid.Row="2" Grid.Column="2" Style="{StaticResource MaterialDesignDisplay2TextBlock}" Margin="0 4 0 4">Regular 45sp</TextBlock>

<TextBlock Grid.Row="3" Grid.Column="0" Margin="0 8 0 0">Display 1 - MaterialDesignDisplay1TextBlock</TextBlock>
<TextBlock Grid.Row="3" Grid.Column="2" Style="{StaticResource MaterialDesignDisplay1TextBlock}" Margin="0 4 0 4">Regular 34sp</TextBlock>

<TextBlock Grid.Row="4" Grid.Column="0" Margin="0 7 0 0">Headline - MaterialDesignHeadlineTextBlock</TextBlock>
<TextBlock Grid.Row="4" Grid.Column="2" Style="{StaticResource MaterialDesignHeadlineTextBlock}" Margin="0 4 0 6">Regular 24sp</TextBlock>

<TextBlock Grid.Row="5" Grid.Column="0" Margin="0 7 0 0">Title - MaterialDesignTitleTextBlock</TextBlock>
<TextBlock Grid.Row="5" Grid.Column="2" Style="{StaticResource MaterialDesignTitleTextBlock}" Margin="0 6 0 8">Medium 20sp</TextBlock>

<TextBlock Grid.Row="6" Grid.Column="0" VerticalAlignment="Center">Subheading - MaterialDesignSubheadingTextBlock</TextBlock>
<TextBlock Grid.Row="6" Grid.Column="2" Style="{StaticResource MaterialDesignSubheadingTextBlock}" Margin="0 8 0 8">Regular 15sp</TextBlock>

<TextBlock Grid.Row="7" Grid.Column="0" VerticalAlignment="Center">Body 2 - MaterialDesignBody2TextBlock</TextBlock>
<TextBlock Grid.Row="7" Grid.Column="2" Style="{StaticResource MaterialDesignBody2TextBlock}" Margin="0 8 0 8">Medium 13sp</TextBlock>

<TextBlock Grid.Row="8" Grid.Column="0" VerticalAlignment="Center">Body 1 - MaterialDesignBody1TextBlock</TextBlock>
<TextBlock Grid.Row="8" Grid.Column="2" Style="{StaticResource MaterialDesignBody1TextBlock}" Margin="0 8 0 8">Regular 13sp</TextBlock>

<TextBlock Grid.Row="9" Grid.Column="0" VerticalAlignment="Center">Caption - MaterialDesignCaptionTextBlock</TextBlock>
<TextBlock Grid.Row="9" Grid.Column="2" Style="{StaticResource MaterialDesignCaptionTextBlock}" Margin="0 8 0 8">Regular 12sp</TextBlock>

<TextBlock Grid.Row="10" Grid.Column="0" VerticalAlignment="Center">Button - MaterialDesignButtonTextBlock</TextBlock>
<TextBlock Grid.Row="10" Grid.Column="2" Style="{StaticResource MaterialDesignButtonTextBlock}" Margin="0 8 0 8">MEDIUM (ALL CAPS) 14sp</TextBlock>



</Grid>
</UserControl>
28 changes: 28 additions & 0 deletions MainDemo.Wpf/Typography.xaml.cs
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace MaterialDesignColors.WpfExample
{
/// <summary>
/// Interaction logic for Typography.xaml
/// </summary>
public partial class Typography : UserControl
{
public Typography()
{
InitializeComponent();
}
}
}
Expand Up @@ -28,7 +28,7 @@
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="wpf:ShadowAssist.ShadowDepth" Value="Depth1" />
<Setter Property="TextBlock.FontWeight" Value="DemiBold"/>
<Setter Property="TextBlock.FontSize" Value="15"/>
<Setter Property="TextBlock.FontSize" Value="14"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
Expand Down
Expand Up @@ -25,6 +25,7 @@
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ScrollViewer.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/materialdesigntheme.slider.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/materialdesigntheme.textbox.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBlock.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/materialdesigntheme.togglebutton.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ToolBar.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ToolBarTray.xaml" />
Expand All @@ -51,7 +52,7 @@
<Style TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource MaterialDesignScrollBar}" />
<Style TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource MaterialDesignScrollViewer}" />
<Style TargetType="{x:Type Slider}" BasedOn="{StaticResource MaterialDesignSlider}" />
<Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource MaterialDesignTextBox}" />
<Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource MaterialDesignTextBox}" />
<Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource MaterialDesignSwitchToggleButton}" />
<Style TargetType="{x:Type ToolBar}" BasedOn="{StaticResource MaterialDesignToolBar}" />
<Style TargetType="{x:Type ToolBarTray}" BasedOn="{StaticResource MaterialDesignToolBarTray}" />
Expand Down
Expand Up @@ -38,6 +38,10 @@
</Style>
<Style TargetType="{x:Type TextBlock}" x:Key="MaterialDesignDisplay4TextBlock">
<Setter Property="FontSize" Value="112"/>
<Setter Property="FontWeight" Value="Regular"/>
<Setter Property="FontWeight" Value="Light"/>
</Style>
<Style TargetType="{x:Type TextBlock}" x:Key="MaterialDesignButtonTextBlock">
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontWeight" Value="Medium"/>
</Style>
</ResourceDictionary>

0 comments on commit 72bc163

Please sign in to comment.