How to specify path for file from different project in WPF?
- by MartyIX
Hello,
I've got two projects in WPF and one project is the main one and the second one is just for testing (it uses files of the main project - files are added via Project - add - Existing items... - selected file - add as link so that the file is only in the main project really).
Folders with projects are these:
C:\Work\...\Projects\Main
C:\Work\...\Projects\XXXTestProject
where XXX stands for different parts of the Main project which I test separately.
I've got the code:
<Window x:Class="Sokoban.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Sokoban"
xmlns:diag="clr-namespace:System.Diagnostics;assembly=WindowsBase"
Title="Window1" Height="559" Width="419">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="GameDesk.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<Grid>
<Rectangle local:GameDeskProperties.FieldSize="30" Name="myrect" Style="{DynamicResource GameDesk}" MouseEnter="Rectangle_MouseEnter" />
</Grid>
</Window>
... which should use XAML resources from GameDesk.xaml which is in the main project and it seems that I can't use Pack URI (http://msdn.microsoft.com/en-us/library/aa970069.aspx). How can I specify the file?
Should I use absolute path? (C:\Work...\Main\Resources\GameDesk.xaml)
Or is there any other way?
Thank you for help!