You have to use a `DynamicResource` for that :
<TextBox FontFamily="{DynamicResource Test}" Margin="135,122,187,180"
Text="test"/>
<Button FontFamily="{DynamicResource Test}" Margin="135,144,329,154"
Content="test"/>
[Read on MSDN about DynamicResource:][1]
Provides a value for any XAML property attribute by deferring that value to be a reference to a defined resource. Lookup behavior for that resource is analogous to run-time lookup.
[1]: https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/ms748942(v=vs.100)?redirectedfrom=MSDN
You have to use a `DynamicResource` for that :
<TextBox FontFamily="{DynamicResource FontFamilyName}" Margin="135,122,187,180"
Text="test"/>
<Button FontFamily="{DynamicResource FontFamilyName}" Margin="135,144,329,154"
Content="test"/>
[Read on MSDN about DynamicResource][1]:
>Provides a value for any XAML property attribute by deferring that value to be a reference to a defined resource. Lookup behavior for that resource is analogous to run-time lookup.
[1]: https://msdn.microsoft.com/en-us/library/vstudio/ms748942(v=vs.100).aspx