I have two keys declared in my resources:
<x:Double x:Key="LargerSize">20</x:Double> <x:Double x:Key="BigSize">24</x:Double> which are used here:
<Style x:Key="baseTitleStyle" TargetType="TextBlock"> <Setter Property="FontFamily" Value="/Assets/Fonts/Poppins-Regular.ttf#Poppins"/> <Setter Property="FontSize" Value="{StaticResource LargerSize}" /> </Style> <Style x:Key="CaptionStyle" TargetType="TextBlock" BasedOn="{StaticResource baseTitleStyle}"> <Setter Property="FontWeight" Value="Bold"/> <Setter Property="FontSize" Value="{StaticResource BigSize}" /> </Style> When programmed in this way:
App.Current.Resources["LargerSize"] = 16d; App.Current.Resources["BigSize"] = 18d; the application crashes with the exception System.Exception: "Разрушительный сбой (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))"