Passing an enum value as command parameter from XAML

I want to pass an enum value as command parameter in WPF, using something like this: <Button x:Name=”uxSearchButton” Command=”{Binding Path=SearchMembersCommand}” CommandParameter=”SearchPageType.First” Content=”Search”> </Button> SearchPageType is an enum and this is to know from which button search command is invoked. Is this possible in WPF, or how can you pass an enum value as command parameter? … Read more

The calling thread must be STA, because many UI components require this

I am using http://www.codeproject.com/KB/IP/Facebook_API.aspx I am trying to call the XAML which is created using WPF. But it gives me an error: The calling thread must be STA, because many UI components require this. I don’t know what to do. I am trying to do this: FacebookApplication.FacebookFriendsList ffl = new FacebookFriendsList(); But it is giving … Read more

ResourceDictionary in a separate assembly

I have resource dictionary files (MenuTemplate.xaml, ButtonTemplate.xaml, etc) that I want to use in multiple separate applications. I could add them to the applications’ assemblies, but it’s better if I compile these resources in one single assembly and have my applications reference it, right? After the resource assembly is built, how can I reference it … Read more

Newline in string attribute

How can I add a line break to text when it is being set as an attribute i.e.: <TextBlock Text=”Stuff on line1 \n Stuff on line2″ /> Breaking it out into the exploded format isn’t an option for my particular situation. What I need is some way to emulate the following: <TextBlock> <TextBlock.Text> Stuff on … Read more