in the above deign there is an issue where in i need to add the reference to the (1)DLL in my sample application to get the usercontrol , is there a way to embed the dll(1) inside dll(2) so that i need to only add reference to the DLl2 in my application
If you create a component DLL project (DLL2) and reference DLL1, it will be copied into a project that references this WinRT component without having to explictly reference DLL1.
Is that what you want to achieve?
Related
I am building a universal class library with Xaml Views that need to statically reference custom resources (StaticResource) defined inside the same class library.
How can i do that in a designer friendly way without importing the resource file inside every view?
Using VS2013 Update 3. It seems that the designer works only for views inside the specific universal app projects and when the resources are defined inside App.xaml without merging.
I am creating a WIX template for my projects to ensure a relatively standard layout.
I have defined a variable to reference the Main Application using <?define MainApp="MyApp"?> where MyApp is the name of the referenced project. I then use the MainApp variable to reference the project's properties in the .wxs and .wxi files.
However, I have an issue when referencing nested properties.
$var.($(var.MainApp).ProjectName) expands to "MyApp" without issue.
$var.($(var.MainApp).ProjectDir)Resources\Main.ico expands to $var.(MyApp.ProjectDir)Resources\Main.ico
$var.($(var.MainApp).TargetPath) expands to $var.(ConsoleApplication1.TargetPath)
etc...
My aim is to create a single definition for my main application, thus eliminating a search/replace, which I find clunky.
As you've found, nested preprocessor variables are not supported by the WiX toolset today.
How can I use the ResourceDictionary resource from the same DLL?
Basically I am trying to create a UI library with all classes derived from Page class. I want to keep all user interface pages in the same DLL.
To see the problem, from VS2012, create a Windows 8 library project, then add the Item Detailed Page. Now, if you open the created page from the editor, you will get some errors like "The resource "LayoutRootStyle" could not be resolved".
This is just a Xaml Designer error, so that will not prevent your project from building or running .
The only thing needed is that all the ResourceDictonary need to be referenced by the main application App.xaml (for example by using <ResourceDictionary Source="/<myLibraryName>/Common/StandardStyles.xaml"/> or by creating calling an Init method in the Library which will dynamically add the Resource dictionary).
A quick workaround for the error in the Xaml Designer is to just copy an App.xaml/App.xaml.cs in your library (but at runtime the main application will still need to have a reference on the needed ResourceDictionary since the App.xaml of the library will not be used).
Another posibility is to just add a refrence on the ResourceDictionary on each page but I believe that will be much more costly since it will create an instance of the dictionary for each page.
I'm trying to add a reference to an external assembly inside XAML
the syntax is the following:
xmlns:my_namespace="using:CompanyName.AssemblyName"
The problem is that the actual class I'd like to use resides under CompanyName.AssemblyName.InnerName namespace.
What's the appropriate way?
Try:
xmlns:my="using:CompanyName.AssemblyName.InnerName"
I have a project which contains all custom controls and images; we'll call it projectBase. Now I have created a windows forms project (project1) that references projectBase. I need to access the embedded resource (images) of projectBase in project1. Any idea how i can pull this off?
In project properties, under Resources, you have the Access Modifier at the top, which you can set as Public. Now you can access resources from the other project like this:
Dim someResource = MyReferencedProject.My.Resources.SomeResource
One option would be to expose the images as readonly properties of your custom control classes.