#Silverlight condition in XAML

Jan 17, 2009 at 6:53 PM
We have been using Prism v2 in our project since last two months. We found that having two diffenent User Controls "Views" for WPF and Silverlight is really bad since we already need to remember to update in two files for the same thing when we are doing the bug-fixing or mataince. I know that style, controls can be shared but I really think that sharing those files should be really great.. 
Jan 17, 2009 at 9:58 PM

There is a way to enable this linking, but it won't happen by default.  In the project file that is linked (the one that has the link entries), if you edit the file in a text editor you will find the exclude filter at the end of the file.  We don't currently have a nice properties page or dialog on top of this, but you should be able to enable xaml files to be synced if you wish.

Jan 19, 2009 at 3:23 AM



We are not able to install the Project Linker in our machines but we are happy with linking the classes manually for the time being. so, linking file manually or by Project linker is not a problem. But we do need to have #Silverlght tag that we can use for checking whether we are running Silverlight or WPF. For example: We are using third-party datagrid in WPF and the build-in Datagrid in Silverlight. So, we are looking for something like 

<!-- #Silverlight 

<data:DataGrid ......... />

<!-- #WPF

<xceed:XceedDatagrid .... ./> 

Is it possible to do that?

Jan 20, 2009 at 6:06 PM

I'm not aware of anything like this.  The teams are working to close some of the differences with things like the WPF and Silverlight toolkits, so you might check these out to see if it will help.   Some of the things in here are previews, so may not be far enough along to support your current needs.