I am looking to change the default resource dictionaries in the WinRT project. Which file should I touch to change the default colours for the system resources in Visual Studio?
generic.xaml is what you're looking for.
It's located at "C:\Program Files (x86)\Windows Kits\8.0\Include\WinRT\Xaml\Design\generic.xaml" by default.
Do not edit this file though. You can always override the styles & templates inside this file in your App.xaml. Just override the default resources with the same x:Key convention.
Related
If you want to use the default styles, colors, etc..., you need to bring them from the generic.xaml file that comes with WindowsAppSDK NuGet packages.
Hence the question, where is located the generic.xaml file?
You can find the default generic.xaml inside each WindowsAppSDK NuGet package folder.
For example, in the case of WindowsAppSDK v1.2.230118.102, you can find 3 generic.xaml files.
First, let's locate the folder for the WindowsAppSDK v1.2.230118.102 NuGet package.
C:\Users\USERNAME\.nuget\packages\microsoft.windowsappsdk\1.2.230118.102
Note: Replace USERNAME with your user name.
Now, inside this folder you'll find 3 generic.xaml files.
\lib\net6.0-windows10.0.17763.0\Microsoft.WinUI\Themes\generic.xaml
\lib\net6.0-windows10.0.18362.0\Microsoft.WinUI\Themes\generic.xaml
\lib\uap10.0\Microsoft.UI\Themes\generic.xaml
AFAIK, these generic.xaml files are identical as long as they belong the same WindowsAppSDK version. But keep in mind that generic.xaml might be different between WindowsAppSDK versions.
If WinUI 3 gets be open sourced, I guess we'll be able to get the generic.xaml file from the repo. But for now, this is the way to go.
UPDATE
Additional sources thanks to #YangXiaoPo-MSFT and #mm8:
microsoft-xaml-ui build project shows the path.
XAML theme resources
Uncompiled styles and templates in GitHub
I am making a project that will be put on a disc to use. This means that all of the files that I call upon have to be on that disc. How and where do I put my files to ensure that they will stay with the project? Does it go in the bin folder? And when I am calling on that file what file path do I use?
In general, the bin folder is not a place you should be storing anything that you want to persist with the project.
When you build, Visual Studio will copy the files needed to run the program into the bin folder, such as libraries and web.config or app.config files.
For other files you want included, add them to your project and set their build action property to Content:
Content - The file is not compiled, but is included in the Content output group.
For example, this setting is the default value for an .htm or other
kind of Web file.
I am trying to port my Windows 8 Store application from Developer Preview to RTM now and I got problems with importing old XAML layout into the newly created project (the old project isn't runnable anymore).
Whenever I import .xaml and .xaml.cs files, they are not recognized as a single file. Rather, two different files are added. How can I import both files as a single "entity", as it happens if I add a new XAML page to my project?
Corresponding .cs or .vb files are imported on import of .xaml files,
but in VS2012 there is one catch:
you must import only one XAML file at a time
If you mark more than one file in file selector, XAML files are not paired correctly with their corresponding code files (even in case if you switch filter to All Files and then select both XAML and code files).
When including XAML files you should have both XAML and xaml.cs files in the same folder, and then in Visual Studio select for including only the XAML files, not the xaml.cs files - they should be included automatically in the process.
In Visual Studio 2015: To add an existing XAMLs with its corresponding code-behind, just copy all the files (.xaml and .vb) via File Explorer and Paste in VS' Solution Explorer.
I want to set web.xml for my first project. For managing project easily i want to arrange files in folders according to their extension in Web Content folder.
Anything wrong with just putting them in exactly those folders?
someapp/js/myscript.js
someapp/css/mystyles.css
My project uses Sandcastle and Sandcastle Help File Builder to generate documentation.
We're using a customized version of script_manifold.js that persists the user's language preference across pages (the default version resets the language preference with each page).
Currently, the script is located in the Sandcastle\presentation\VS2005\scripts folder.
Is there a way to override this script with a custom version, without having to mess with the Sandcastle installation? That is, can I have a file that is checked into source control along with my source code, and somehow have that file used by SHFB instead of the default Sandcastle one?
Never mind, I found the answer!
In the SHFB project explorer window, you can just create a folder with the same name as the presentation style content you wish to override. This works with any stock content, such as HTML, CSS or JS files. So in my situation, I needed to override the script_manifold.js file which lives in the Scripts folder of the VS2005 presentation style.
So I needed to create a folder called Scripts in my SHFB project, then put my script_manifold.js in that folder.
It all works perfectly. Excellent!