How can I localize strings in Xaml files for WPFLocalizationExtension - wpf

I'm using WPFLocalizationExtension to localize my WPF application. I'm very happy with the run-time behavior, but extracting string properties manually to ResX files is very tedious.
Is there a way to automate this? I used to have a tool called Xaml Localizer Addin that did exactly this (screenshot below), but it only works with VS2008 and I couldn't find a newer version.

If you're using visual studio 2010, you may want to check out Xaml Localization Tool. It's an extension for vs2010 to localize xaml application, and generate .resx files from xaml.
Another idea is to download XAML Localize Source Code and build your own visual studio add-in or tool that is compatible with your version of .net.

Related

How do I hide/integrate dll files using Visual Studio Installer?

Using Visual Studio Installer, I created the .msi file for the WPF project and the class library for the custom action. Everything works fine, but there are many dll assembly files associated with the project in C:\Program Files (x86)\Publisher\Program.
I applied Fody.Costura to WPF project after researching when building the WPF project. Therefore, it is working properly in the release/debug folder of the WPF project. When I tried adding a WPF project with 'project out...' to Visual Studio Installer, regardless of Fody.Costura, dlls appeared. On the client-side, there are still dlls. Can they be hidden under the program files folder?
FYI. WPF project is built on .NET Framework 4.8.
I found a way to hide dll files using the Hidden property. By setting this property to 'True', DLL files become hidden but still exist. If you have other ways, feel free to leave your comment.

How to do a batch run to apply "XAML styler" to all xaml files in a Visual Studio 2019 project

Our team just decided to use XAML styler for all of our .xaml files. Since we already have a large codebase we want to apply the styling for all existing files to have a clean start.
Is there a plugin for Visual Studio 2019 which can apply XAML styler plugin to all xaml files in the project? I tried Google but wasn't able to find any.
By default, XAML Styler will format each opened XAML file when saving. Therefore, the manual way would be to open all XAML files and Save or Save All.
Alternatively, you can just create a command line script for all XAML files and run XAML Styler on it, see this page in the GitHub Wiki there is already an example.
If you are looking for an extension that will do the same in Visual Studio directly, use Format All Files. It explicitly supports formatting all XAML files in a project or solution with XAML Styler.
You can change the options in "Tools" -> "Options" -> "Format All Files". [...]
If you want to format XAML files, install XAML Styler and set the option "Other Execution Command" to "EditorContextMenus.XAMLEditor.FormatXAML".

VS How To Enable XAML Visual Editor for Xaml files (outside of WPF project)?

Visual Studio Community 2015. Xamarin Test Project.
I have a project which have some layouts - Layout.xaml
It shows the designer - it looks like an XML editor of some sort - but what I am looking for is the Visual Xaml Designer - where you see the results of what you do.
If you open any WPF project you will and doulbe click any of its default Xaml files - you will see a nice looking Xaml Visual and Code Editor combined. How can I enable the same within my Xamarin project?
Why Xaml that is in WPF project shows that nice Visual Editor and Xamarin Project does not? Is there a way to bind it?
It has to depend on the project type I assume.
PS: I have a droid project and the iOS and a portable library where I have those XAML files.
If you have any more questions - please ask.
Update
I tried installing Microsoft.Xaml (through Nuget Package manager) - still no luck
Update 2
I create a basic WPF project and look at its references. I matched it identically with my project - but still no luck
Update 3
WPF Project has different properties (which makes sense)
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
And my XAML files have these
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Even though I knew manipulating those would not launch Xaml Visual Designer - still tried that with no luck.
What loads this XAML Visual Designer for the WPF project????
This is the answer - there is a Xamarin.Forms Previewer
Use the View > Other Windows > Xamarin.Forms Previewer menu in Visual Studio to open the preview window. Use the Window > New Vertical Tab Group menu to position it side-by-side.
There is no direct possibility for a preview of your XAML-views, but you can use Gorilla Player(http://gorillaplayer.com/) a software which allows a such function

How to use Expression Blend 4 to Edit XAML file from VS2010 F# Project?

I am not sure if this is possible but I want to create an F# Application in Visual Studio 2010. I then want to create the WPF GUI via XAML files which I edit via Expression Blend 4.
Blend does not allow F# Projects to be created. VS2010 does not allow XAML files to be created.
I have followed the steps here : http://msdn.microsoft.com/en-us/library/hh273078.aspx
However when I open the Solution in Blend I can't see the XAML files in 'design' mode.
Is this possible?
I figured out that to make the XAML file editable in Design view of Blend I had to change from the default F# Application (Console) to F# Application (Windows) and secondly add the PresentationFoundation.dll as a resource.
From the fsproj file.
- <OutputType>WinExe</OutputType>
- <Reference Include="PresentationFramework" />
Blend generally doesn't like XAML files that are set to Resource. It expects XAML files to be Page or Content (caveat emptor: no reference, just my experience). Unless you need the XAML to be with the F#, I'd put it in a separate WPF control library project.

Recover WinForms from dll

We think most of the source has been recovered through .NET Reflector. A utility which export the dll as C# source.
The only missing part is WinForms which is not included when .NET Reflector export the dll source.
Is there any way to get the WinForms recover from dll?
Thanks.
If it's not in the dll, you can't get it out :-)
But possible some class files are the forms you're searching for. Maybe you have to add a reference to System.Windows.Forms.dll to your project.
From Visual Studio 2005 on, Windows Forms classes are partial classes split into a Designer generated part (MyForm.designer.cs) and your actual implementation (MyForm.cs). You can see that in Explorer when you create a new Form from scratch.
In order to resolve your problem you would have to split up the class exported by Reflector the same way that Visual Studio does: Place the InitializeComponent() method and all control declarations into the MyForm.designer.cs file and the remaining code into the MyForm.cs file.

Resources