-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Expand file tree
/
Copy pathApp.xaml
More file actions
153 lines (140 loc) · 8.68 KB
/
App.xaml
File metadata and controls
153 lines (140 loc) · 8.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<Application x:Class="MaterialDesignDemo.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:materialDesignDemo="clr-namespace:MaterialDesignDemo"
xmlns:smtx="clr-namespace:ShowMeTheXAML;assembly=ShowMeTheXAML"
xmlns:smtxAe="clr-namespace:ShowMeTheXAML.AvalonEdit;assembly=ShowMeTheXAML.AvalonEdit"
xmlns:system="clr-namespace:System;assembly=mscorlib"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!-- This is the current way to set up your app's initial theme -->
<!-- PrimaryColor and SecondaryColor also support the constant string "Inherit" to specify the color should use the system theme accent color -->
<materialDesign:BundledTheme BaseTheme="Inherit"
ColorAdjustment="{materialDesign:ColorAdjustment}"
PrimaryColor="DeepPurple"
SecondaryColor="Lime" />
<!--
If you would prefer to use your own colors, there is an option for that as well:
PrimaryColor and SecondaryColor also support the constant string "Inherit" to specify the color should use the system theme accent color
-->
<!--<materialDesign:CustomColorTheme BaseTheme="Light" PrimaryColor="Aqua" SecondaryColor="#FF006400" />-->
<!-- You can also use the built-in theme dictionaries: -->
<!--
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Secondary/MaterialDesignColor.Lime.xaml" />
-->
<!-- NB: If you're migrating and not wanting to update your brushes, you will want this resource dictionary for the old brush names: -->
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ObsoleteBrushes.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesign2.Defaults.xaml" />
<ResourceDictionary Source="pack://application:,,,/ShowMeTheXAML.AvalonEdit;component/Themes/xamldisplayer.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style TargetType="smtx:XamlDisplay" BasedOn="{StaticResource {x:Type smtx:XamlDisplay}}">
<Style.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Button.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ToggleButton.xaml" />
</ResourceDictionary.MergedDictionaries>
<smtxAe:TextDocumentValueConverter x:Key="TextDocumentValueConverter" />
</ResourceDictionary>
</Style.Resources>
<Setter Property="Formatter">
<Setter.Value>
<smtx:XamlFormatter Indent=" " NewLineOnAttributes="True">
<smtx:XamlFormatter.NamespacesToRemove>
<system:String>http://materialdesigninxaml.net/winfx/xaml/themes</system:String>
</smtx:XamlFormatter.NamespacesToRemove>
</smtx:XamlFormatter>
</Setter.Value>
</Setter>
<Setter Property="HorizontalContentAlignment" Value="Right" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="smtx:XamlDisplay">
<DockPanel>
<materialDesign:PopupBox x:Name="PopupBox"
Padding="10"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
DockPanel.Dock="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(materialDesignDemo:XamlDisplayEx.ButtonDock)}"
IsTabStop="False"
StaysOpen="True">
<materialDesign:PopupBox.ToggleContent>
<materialDesign:PackIcon Margin="3"
Background="Transparent"
Cursor="Hand"
Foreground="{DynamicResource PrimaryHueDarkBrush}"
Kind="Xml"
ToolTip="View XAML">
<materialDesign:PackIcon.Style>
<Style TargetType="materialDesign:PackIcon" BasedOn="{StaticResource {x:Type materialDesign:PackIcon}}">
<Setter Property="Opacity" Value="0.4" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Opacity" Value="1" />
</Trigger>
</Style.Triggers>
</Style>
</materialDesign:PackIcon.Style>
</materialDesign:PackIcon>
</materialDesign:PopupBox.ToggleContent>
<Border MaxWidth="800" MaxHeight="600">
<DockPanel>
<Button Margin="0,10,0,0"
HorizontalAlignment="Right"
Command="Copy"
CommandParameter="{Binding Xaml, RelativeSource={RelativeSource TemplatedParent}}"
Content="_COPY"
DockPanel.Dock="Bottom"
Style="{StaticResource MaterialDesignRaisedButton}"
Tag="{Binding Xaml, RelativeSource={RelativeSource TemplatedParent}}" />
<avalonEdit:TextEditor Document="{Binding Xaml, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TextDocumentValueConverter}}" Style="{StaticResource AvalonTextEditorXamlDisplay}" />
</DockPanel>
</Border>
</materialDesign:PopupBox>
<Grid>
<AdornerDecorator>
<Border Margin="-5"
BorderBrush="{DynamicResource SecondaryHueMidBrush}"
Opacity=".4">
<Border.Style>
<Style TargetType="Border">
<Setter Property="BorderThickness" Value="0" />
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=PopupBox, Path=IsPopupOpen}" Value="True">
<Setter Property="BorderThickness" Value="5" />
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
</Border>
</AdornerDecorator>
<ContentPresenter />
</Grid>
</DockPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="VerticalContentAlignment" Value="Bottom" />
<Setter Property="materialDesignDemo:XamlDisplayEx.ButtonDock" Value="Right" />
</Style>
<Style TargetType="TextBlock" BasedOn="{StaticResource MaterialDesignHeadline5TextBlock}" x:Key="PageTitleTextBlock">
<Setter Property="Margin" Value="0 0 0 24"/>
</Style>
<Style TargetType="TextBlock" BasedOn="{StaticResource MaterialDesignHeadline6TextBlock}" x:Key="PageSectionTitleTextBlock">
<Setter Property="Margin" Value="0 0 0 16"/>
</Style>
<Style TargetType="Rectangle" x:Key="PageSectionSeparator">
<Setter Property="Margin" Value="0,24" />
<Setter Property="Height" Value="1" />
<Setter Property="Fill" Value="{DynamicResource MaterialDesignDivider}" />
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>