Skip to content

Commit 019c5d6

Browse files
committed
Merge branch 'Keboo-smtx'
2 parents 538ebea + 482e9f6 commit 019c5d6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2943
-2068
lines changed

.paket/Paket.Restore.targets

Lines changed: 267 additions & 0 deletions
Large diffs are not rendered by default.

.paket/paket.bootstrapper.exe

23.8 KB
Binary file not shown.

.paket/paket.exe

95.5 KB
Binary file not shown.

.paket/paket.targets

Lines changed: 52 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,72 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
34
<PropertyGroup>
45
<!-- Enable the restore command to run before builds -->
56
<RestorePackages Condition=" '$(RestorePackages)' == '' ">true</RestorePackages>
6-
<!-- Download Paket.exe if it does not already exist -->
7-
<DownloadPaket Condition=" '$(DownloadPaket)' == '' ">true</DownloadPaket>
87
<PaketToolsPath>$(MSBuildThisFileDirectory)</PaketToolsPath>
98
<PaketRootPath>$(MSBuildThisFileDirectory)..\</PaketRootPath>
9+
<PaketLockFilePath>$(PaketRootPath)paket.lock</PaketLockFilePath>
10+
<PaketRestoreCacheFile>$(PaketRootPath)paket-files\paket.restore.cached</PaketRestoreCacheFile>
1011
<MonoPath Condition="'$(MonoPath)' == '' And Exists('/Library/Frameworks/Mono.framework/Commands/mono')">/Library/Frameworks/Mono.framework/Commands/mono</MonoPath>
1112
<MonoPath Condition="'$(MonoPath)' == ''">mono</MonoPath>
1213
</PropertyGroup>
14+
1315
<PropertyGroup>
1416
<!-- Paket command -->
17+
<PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketRootPath)paket.exe')">$(PaketRootPath)paket.exe</PaketExePath>
1518
<PaketExePath Condition=" '$(PaketExePath)' == '' ">$(PaketToolsPath)paket.exe</PaketExePath>
16-
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
1719
<PaketCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
1820
<PaketCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand>
19-
<PaketBootStrapperCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketBootStrapperExePath)" $(PaketBootStrapperCommandArgs)</PaketBootStrapperCommand>
20-
<PaketBootStrapperCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 $(PaketBootStrapperExePath) $(PaketBootStrapperCommandArgs)</PaketBootStrapperCommand>
21-
<!-- Commands -->
22-
<PaketReferences Condition="!Exists('$(MSBuildProjectFullPath).paket.references')">$(MSBuildProjectDirectory)\paket.references</PaketReferences>
23-
<PaketReferences Condition="!Exists('$(PaketReferences)')">$(MSBuildStartupDirectory)\paket.references</PaketReferences>
24-
<PaketReferences Condition="Exists('$(MSBuildProjectFullPath).paket.references')">$(MSBuildProjectFullPath).paket.references</PaketReferences>
25-
<RestoreCommand>$(PaketCommand) restore --references-files "$(PaketReferences)"</RestoreCommand>
26-
<DownloadPaketCommand>$(PaketBootStrapperCommand)</DownloadPaketCommand>
21+
</PropertyGroup>
22+
23+
<Choose> <!-- MyProject.fsproj.paket.references has the highest precedence -->
24+
<When Condition="Exists('$(MSBuildProjectFullPath).paket.references')">
25+
<PropertyGroup>
26+
<PaketReferences>$(MSBuildProjectFullPath).paket.references</PaketReferences>
27+
</PropertyGroup>
28+
</When> <!-- MyProject.paket.references -->
29+
<When Condition="Exists('$(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references')">
30+
<PropertyGroup>
31+
<PaketReferences>$(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references</PaketReferences>
32+
</PropertyGroup>
33+
</When> <!-- paket.references -->
34+
<When Condition="Exists('$(MSBuildProjectDirectory)\paket.references')">
35+
<PropertyGroup>
36+
<PaketReferences>$(MSBuildProjectDirectory)\paket.references</PaketReferences>
37+
</PropertyGroup>
38+
</When> <!-- Set to empty if a reference file isn't found matching one of the 3 format options -->
39+
<Otherwise>
40+
<PropertyGroup>
41+
<PaketReferences></PaketReferences>
42+
</PropertyGroup>
43+
</Otherwise>
44+
</Choose>
45+
46+
<PropertyGroup>
47+
<!-- Commands -->
48+
<RestoreCommand>$(PaketCommand) restore --references-file "$(PaketReferences)"</RestoreCommand>
2749
<!-- We need to ensure packages are restored prior to assembly resolve -->
2850
<BuildDependsOn Condition="$(RestorePackages) == 'true'">RestorePackages; $(BuildDependsOn);</BuildDependsOn>
2951
</PropertyGroup>
30-
<Target Name="CheckPrerequisites">
31-
<!-- Raise an error if we're unable to locate paket.exe -->
32-
<Error Condition="'$(DownloadPaket)' != 'true' AND !Exists('$(PaketExePath)')" Text="Unable to locate '$(PaketExePath)'" />
33-
<MsBuild Targets="DownloadPaket" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadPaket=$(DownloadPaket)" />
34-
</Target>
35-
<Target Name="DownloadPaket">
36-
<Exec Command="$(DownloadPaketCommand)" IgnoreStandardErrorWarningFormat="true" Condition=" '$(DownloadPaket)' == 'true' AND !Exists('$(PaketExePath)')" />
37-
</Target>
38-
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
39-
<Exec Command="$(RestoreCommand)" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(PaketRootPath)" Condition="Exists('$(PaketReferences)')" ContinueOnError="true" />
52+
<Target Name="RestorePackages">
53+
<PropertyGroup>
54+
<PaketRestoreRequired>true</PaketRestoreRequired>
55+
</PropertyGroup>
56+
57+
<PropertyGroup Condition="Exists('$(PaketRestoreCacheFile)') ">
58+
<PaketRestoreCachedHash>$([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)'))</PaketRestoreCachedHash>
59+
<PaketRestoreLockFileHash>$([System.IO.File]::ReadAllText('$(PaketLockFilePath)'))</PaketRestoreLockFileHash>
60+
<PaketRestoreRequired>true</PaketRestoreRequired>
61+
<PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '$(PaketRestoreCachedHash)' ">false</PaketRestoreRequired>
62+
<PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '' ">true</PaketRestoreRequired>
63+
</PropertyGroup>
64+
65+
<Exec Command="$(RestoreCommand)"
66+
IgnoreStandardErrorWarningFormat="true"
67+
WorkingDirectory="$(PaketRootPath)"
68+
ContinueOnError="false"
69+
Condition=" '$(PaketRestoreRequired)' == 'true' AND Exists('$(PaketReferences)') AND '$(PaketReferences)' != '' "
70+
/>
4071
</Target>
4172
</Project>

MainDemo.Wpf/App.xaml

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
<Application x:Class="MaterialDesignColors.WpfExample.App"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXAML;assembly=ShowMeTheXAML"
5+
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
6+
xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
7+
xmlns:smtxAe="clr-namespace:ShowMeTheXAML.AvalonEdit;assembly=ShowMeTheXAML.AvalonEdit"
8+
xmlns:system="clr-namespace:System;assembly=mscorlib"
9+
xmlns:materialDesignDemo="clr-namespace:MaterialDesignDemo"
410
StartupUri="MainWindow.xaml">
511
<Application.Resources>
612
<ResourceDictionary>
@@ -10,8 +16,96 @@
1016
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
1117
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
1218
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
13-
19+
<ResourceDictionary Source="pack://application:,,,/ShowMeTheXAML.AvalonEdit;component/Themes/xamldisplayer.xaml" />
1420
</ResourceDictionary.MergedDictionaries>
21+
22+
<Style TargetType="showMeTheXaml:XamlDisplay" BasedOn="{StaticResource {x:Type showMeTheXaml:XamlDisplay}}">
23+
<Style.Resources>
24+
<ResourceDictionary>
25+
<ResourceDictionary.MergedDictionaries>
26+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ToggleButton.xaml" />
27+
</ResourceDictionary.MergedDictionaries>
28+
29+
<smtxAe:TextDocumentValueConverter x:Key="TextDocumentValueConverter"/>
30+
</ResourceDictionary>
31+
</Style.Resources>
32+
<Setter Property="VerticalContentAlignment" Value="Bottom" />
33+
<Setter Property="HorizontalContentAlignment" Value="Right" />
34+
<Setter Property="materialDesignDemo:XamlDisplayEx.ButtonDock" Value="Right" />
35+
<Setter Property="Formatter">
36+
<Setter.Value>
37+
<showMeTheXaml:XamlFormatter NewLineOnAttributes="True" Indent=" ">
38+
<showMeTheXaml:XamlFormatter.NamespacesToRemove>
39+
<system:String>http://materialdesigninxaml.net/winfx/xaml/themes</system:String>
40+
</showMeTheXaml:XamlFormatter.NamespacesToRemove>
41+
</showMeTheXaml:XamlFormatter>
42+
</Setter.Value>
43+
</Setter>
44+
<Setter Property="Template">
45+
<Setter.Value>
46+
<ControlTemplate TargetType="showMeTheXaml:XamlDisplay">
47+
<DockPanel>
48+
<materialDesign:PopupBox DockPanel.Dock="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(materialDesignDemo:XamlDisplayEx.ButtonDock)}"
49+
Padding="10" StaysOpen="True" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
50+
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
51+
x:Name="PopupBox">
52+
<materialDesign:PopupBox.ToggleContent>
53+
<materialDesign:PackIcon Kind="Xaml" Cursor="Hand" ToolTip="View XAML"
54+
Foreground="{DynamicResource PrimaryHueDarkBrush}"
55+
Background="Transparent"
56+
Margin="3">
57+
<materialDesign:PackIcon.Style>
58+
<Style TargetType="materialDesign:PackIcon" BasedOn="{StaticResource {x:Type materialDesign:PackIcon}}">
59+
<Setter Property="Opacity" Value="0.2" />
60+
<Style.Triggers>
61+
<Trigger Property="IsMouseOver" Value="True">
62+
<Setter Property="Opacity" Value="1" />
63+
</Trigger>
64+
</Style.Triggers>
65+
</Style>
66+
</materialDesign:PackIcon.Style>
67+
</materialDesign:PackIcon>
68+
</materialDesign:PopupBox.ToggleContent>
69+
<Border MaxHeight="600" MaxWidth="800">
70+
<StackPanel>
71+
<avalonEdit:TextEditor Document="{Binding Xaml, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TextDocumentValueConverter}}"
72+
Style="{StaticResource AvalonTextEditorXamlDisplay}" />
73+
<Button
74+
Margin="0 10 0 0"
75+
Tag="{Binding Xaml, RelativeSource={RelativeSource TemplatedParent}}"
76+
HorizontalAlignment="Right"
77+
Command="Copy"
78+
CommandParameter="{Binding Xaml, RelativeSource={RelativeSource TemplatedParent}}"
79+
Content="_COPY"
80+
Style="{StaticResource MaterialDesignRaisedButton}">
81+
</Button>
82+
</StackPanel>
83+
</Border>
84+
85+
</materialDesign:PopupBox>
86+
<Grid>
87+
<AdornerDecorator>
88+
<Border BorderBrush="{DynamicResource SecondaryAccentBrush}" Opacity=".4" Margin="-5">
89+
<Border.Style>
90+
<Style TargetType="Border">
91+
<Setter Property="BorderThickness" Value="0" />
92+
<Style.Triggers>
93+
<DataTrigger Binding="{Binding ElementName=PopupBox, Path=IsPopupOpen}" Value="True">
94+
<Setter Property="BorderThickness" Value="5" />
95+
</DataTrigger>
96+
</Style.Triggers>
97+
</Style>
98+
</Border.Style>
99+
</Border>
100+
</AdornerDecorator>
101+
<ContentPresenter />
102+
</Grid>
103+
</DockPanel>
104+
</ControlTemplate>
105+
</Setter.Value>
106+
</Setter>
107+
</Style>
15108
</ResourceDictionary>
16109
</Application.Resources>
17110
</Application>
111+

MainDemo.Wpf/App.xaml.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Configuration;
4-
using System.Data;
5-
using System.Globalization;
6-
using System.Linq;
7-
using System.Threading;
8-
using System.Threading.Tasks;
1+
using ShowMeTheXAML;
92
using System.Windows;
10-
using System.Windows.Markup;
113

124
namespace MaterialDesignColors.WpfExample
135
{
@@ -18,6 +10,7 @@ public partial class App : Application
1810
{
1911
protected override void OnStartup(StartupEventArgs e)
2012
{
13+
XamlDisplay.Init();
2114
//Illustration of setting culture info fully in WPF:
2215
/*
2316
Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");

0 commit comments

Comments
 (0)