Hi. I do not know how to use a defined Application Style Resource in code. I have defined:
<Application.Resources> <Style x:Key="OrangeButton" TargetType="{x:Type Button}">
I am using this resource in the XAML section of my application like:
<Button Name="Button_Start" style="{StaticResource OrangeButton}" Margin="0">
and it is working fine, and I can also change the Button Style by code
Button_Start.Style = CType(FindResource("RedButton"), Style)
but only in the VB file that was automatically created when I created my new project. If I add a new class file and try do the same it says:
Name 'FindResource' is not declared
My problem is therefore, how to make use of Application resources in all the different class files in my application.
Peter