Logrus
Topic Author
Posts: 59
Joined: 22 Jul 2015, 12:16

Visibility as StaticResource

07 Aug 2024, 17:08

Hi
I want to use the application dictionary to adjust the visibility of interface elements
    
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    
    <Application.Resources>
        <ResourceDictionary>
		<sys:String x:Key="LayoutName">LayoutConfigurationName</sys:String>
	        <sys:Boolean x:Key="IsPlatform">False</sys:Boolean>
		<Visibility x:Key="Visibility.Text">Hidden</Visibility>	
	</ResourceDictionary>
    </Application.Resources>
and get error
Enum node can't have attributes.
I wrapped Visibility in a component and use
        
        <ResourceDictionary>
		<VisibilityBoxed x:Key="Visibility.Text" Value="Hidden"/>	
	</ResourceDictionary>
	...
	<Grid Visibility={Binding Source={StaticResource Visibility.Text}, Path=Value}/>
	
Its worked.

How are system classes implemented: sys:String, sys:Double, sys::Boolean?
 
User avatar
sfernandez
Site Admin
Posts: 3112
Joined: 22 Dec 2011, 19:20

Re: Visibility as StaticResource

12 Aug 2024, 13:33

Defining enum values as resources was not working before 3.2.4 version, but it should be fine now, what version are you using?
 
Logrus
Topic Author
Posts: 59
Joined: 22 Jul 2015, 12:16

Re: Visibility as StaticResource

12 Aug 2024, 13:43

Defining enum values as resources was not working before 3.2.4 version, but it should be fine now, what version are you using?
We are using version 3.2.2
 
Logrus
Topic Author
Posts: 59
Joined: 22 Jul 2015, 12:16

Re: Visibility as StaticResource

12 Aug 2024, 13:44

but it should be fine now
Ok, Thanks

Who is online

Users browsing this forum: Bing [Bot] and 1 guest