A scratchpad from May 2019 for trying out the
MaterialDesignInXamlToolkit
controls in WPF — cards, chips, dialog hosts, popup boxes, pack icons — while I was building
my university messenger project (Messeger, started
a month earlier) in a separate repository. It is a sandbox, not an application: nothing here
connects to anything, no button is wired to logic, and both projects open a window and stop.
It is archived as a record of how I was learning WPF, and it is not maintained.
Screenshots taken in July 2026 from a throwaway copy of this repository with two project-file edits: retarget
v4.6.1→v4.7.2, and delete the dead Microsoft Fakes reference (see Does it build?). No C# and no XAML was modified, and nothing in this repository was changed.
Archived, and left exactly as it was written. Nine commits over eight days, 16–23 May 2019. It is a UI spike — there is no logic to reuse and nothing here worth depending on.
It did run in 2019, and it still runs today once the two project-file edits above are applied. What it does not do is build as committed; that is covered below and is the most interesting thing about the repo now.
- Written: 16–23 May 2019, 9 commits over 8 days
- Stack: C#, WPF, .NET Framework 4.6.1, MaterialDesignThemes 2.5.1
- Size: ~372 lines of XAML, ~109 lines of hand-written C# (49 of them in one file)
- Original preserved as: the
v0.1-originaltag
The repository is Design-Materials-Experements; the project folder inside it is
DesidnMaterialsExperements. Those are two different misspellings of "Design", plus a
consistent one of "Experiments", and I have left both alone — renaming now would only hide
what the repo is. In the same spirit, the second project is called Game and contains no
game at all; it is the messenger UI.
Two WPF projects in one solution, neither of which references the other.
| Project | What it is |
|---|---|
DesidnMaterialsExperements |
The original experiment: can Material Design cards be used as chat bubbles inside a RichTextBox? |
Game |
Five throwaway messenger screens — Login, Register, Profile, Add new chat, Add recipients |
The screenshot above is the whole of the first project. A RichTextBox is given a teal
background and used as a message canvas; each "message" is a Material Design Card placed
in a FlowDocument paragraph, three declared in XAML and one built in code-behind
(MainWindow.xaml.cs). Right-hand alignment is attempted with HorizontalAlignment="Right"
on three of the four bubbles — only the one that also sets FlowDirection="RightToLeft" on
its paragraph actually ends up on the right.
The experiment answered its own question, and the answer was no. The messenger this fed
into contains no RichTextBox anywhere; it renders messages with ListBox and
ItemsControl instead.
The one screen with real code behind it (AddRecipients.xaml.cs, 49 lines): a search box
filtering 16 hard-coded contacts, each row a toggle button plus name and handle, with the
selected rows kept pinned at the top of the list as the filter changes.
This one worked well enough to keep. It was transplanted more or less verbatim into the
messenger client, misspellings and placeholder names included — the same
ItemsControl x:Name="pararara", the same SelectableVievModel class, the same
SharedSizeGroup="Checkerz", the same DataTrigger on IsSelected.
The picker opens empty, which is not obvious from the screenshot: the 16 contacts are only added to the list once you type. See the retrospective.
No — not as committed, on any machine you are likely to have today. Measured 2026-07-28 on Windows 10:
| Toolchain | Result |
|---|---|
| VS 2019 Build Tools | error MSB3644: The reference assemblies for .NETFramework,Version=v4.6.1 were not found |
| VS 2022 Enterprise 17.x | identical MSB3644 |
.NET Framework 4.6.1 went out of support on 2022-04-26 and current Visual Studio installers
no longer ship its targeting pack. On this machine the v4.6.1 reference-assembly folder
still exists but holds only 126 leftover XML documentation files — not one .dll.
Retargeting a scratch copy to v4.7.2 gets Game building, but the namesake project still
fails:
BuildFakesAssemblies:
DesidnMaterialsExperements\Fakes\MaterialDesignColors.fakes : error : Could not find a part
of the path '...\obj\Debug\Fakes\mdc\b\MaterialDesignColors.1.1.3.0.Fakes.fakesconfig'.
Result: error while compiling the generated code (-1007 - 0xfffffc11)
At some point in 2019 I right-clicked Add Fakes Assembly on the MaterialDesignColors
reference. Microsoft Fakes is a unit-testing shim generator, Visual Studio Enterprise only,
and this is a WPF application project with no tests in it — the generated assembly is
referenced by the .csproj and used by exactly nothing. It is now the single thing standing
between this project and a clean build.
Deleting three lines from DesidnMaterialsExperements.csproj — the
MaterialDesignColors.1.1.3.0.Fakes reference, the Microsoft.QualityTools.Testing.Fakes
reference, and the <Fakes Include="Fakes\MaterialDesignColors.fakes" /> item — plus the
retarget, is enough:
DesidnMaterialsExperements -> ...\bin\Debug\DesidnMaterialsExperements.exe
Game -> ...\bin\Debug\Game.exe
EXITCODE=0
Zero warnings, zero C# or XAML changes. The code was never the problem; the project file rotted around it.
Windows only. Requires a .NET Framework developer pack (4.7.2 or newer) and MSBuild.
The project predates the SDK format, so restore needs the packages.config switch:
msbuild DesidnMaterialsExperements.sln -t:Restore -p:RestorePackagesConfig=true
msbuild DesidnMaterialsExperements.sln -t:Build -p:TargetFrameworkVersion=v4.7.2
.\Game\bin\Debug\Game.exe # messenger screens
.\DesidnMaterialsExperements\bin\Debug\DesidnMaterialsExperements.exe # chat canvasDesidnMaterialsExperements.exe will not build until the three Fakes lines are removed —
-p:TargetFrameworkVersion cannot work around that one.
Game.exe opens a window containing a single unlabelled full-width teal button. Clicking it
opens the contact picker. The other four screens cannot be reached at all: Login and
Profile are commented out in MainWindow.xaml.cs, and Register and Add new chat are
not referenced by any line of code in the repository.
There are none, and there is nothing here that could sensibly be tested — the whole repository contains exactly two event handlers, and the only non-trivial one is the contact filter. The lone appearance of a testing framework here is the broken Fakes reference described above, which was never used to write a test.
DesidnMaterialsExperements.sln
├─ DesidnMaterialsExperements/ the chat-canvas experiment
│ ├─ MainWindow.xaml teal RichTextBox, cards, chip, assorted stray controls
│ ├─ MainWindow.xaml.cs builds a fourth bubble in code
│ └─ Fakes/ dead Microsoft Fakes config — breaks the build
└─ Game/ messenger screens (no game)
├─ MainWindow.xaml one unlabelled button in a DialogHost
├─ AddRecipients.xaml(.cs) the contact picker — the only real code
├─ SelectableVievModel.cs a five-property DTO, despite the name
├─ Login.xaml, Register.xaml, Profile.xaml, "Add new chat.xaml"
Things I would flag immediately reviewing this today. Each was reproduced by building and running the original, not inferred from reading it.
A test-only dependency was wired into a shipping app, and eventually broke it. The Fakes shim above is the clearest single lesson in the repo: a tool added by clicking a context-menu item I did not understand, committed without ever being used, which then sat there until it was the only reason the project would not compile. I would not know from reading the code that anything was wrong — only from trying to build it.
The contact picker opens empty. The constructor loads 16 contacts into a List field,
then the search handler is the only code that ever puts anything on screen — and it
early-returns on an empty string. So the window shows a blank panel until you type, and goes
blank again if you clear the box. The fix is one line (bind ItemsSource, or seed the list
in the constructor); the cause is that Items and pararara.Items are two separate
collections that were never connected, which is precisely the mistake ItemsSource exists
to prevent.
The search is case-sensitive, because it is three raw string.Contains calls. Typing
Shpack finds Dmitrius Shpack; typing shpack finds nothing. Worse, it is
inconsistently invisible — searching dm does return that contact, but only by accidentally
matching the @dmitr handle rather than the name, so the bug hides itself on the most
obvious test input. StringComparison.OrdinalIgnoreCase was the whole fix.
The chat canvas is editable. IsReadOnlyCaretVisible="True" is set on the RichTextBox
but IsReadOnly is not, so a RichTextBox used to display a conversation behaves the way a
RichTextBox always does — I typed two lines directly into the middle of the message
history while testing. That is the right reason to abandon the approach, and abandoning it
was the correct call.
One control never renders at all. The ANZ Bank chip in MainWindow.xaml sets
Grid.Row="2" on a Grid that defines two rows. WPF clamps the out-of-range index to the
last row — the same cell as the card declared just after it — so the chip is painted and
then covered. Deleting the card makes it appear, which is how I confirmed it. Nothing warns
you: an out-of-range Grid.Row is silently legal.
- Nothing is connected. No network, no storage, no authentication, no validation. Every ACCEPT and CANCEL button in every dialog has no click handler at all.
- Does not build as committed — see above.
- All data is hard-coded, including my own name and a fake email and phone number on the profile screen.
- Mixed languages in one UI. Ukrainian (
Зберегти,Відміна,Назва Чату) and English (ACCEPT,CANCEL) appear side by side in the same dialogs, with no localisation. - Layout is absolute. The first project positions controls with designer-generated pixel
margins like
Margin="355,342,0,0"; nothing reflows when the window is resized. - A dead dependency in both projects.
ShowMeTheXAMLis in bothpackages.configfiles and both.csprojfiles, and referenced by zero lines of code. - Names are poor throughout — a project called
Gamethat holds a messenger, anItemsControlcalledpararara,SelectableVievModel,FindUsersByParticipans, and a source file with a space in its name (Add new chat.xaml) that breaks shell globbing. - Commented-out code left in place, most of it a large block of
Transitionersample XAML pasted from the toolkit demo app.
MIT.

