How can I find namespace in xaml? - xaml

If you look at SettingsPage.xaml in a project created by TemplateStudio, you will find the following code: It doesn't work if I write the same code on the project I created without TemplateStudio. How can I find namespace Microsoft.UI.Xaml?
I'm working on the WinUI3 project.
<Page xmlns:xaml="using:Microsoft.UI.Xaml">
<RadioButton>
<RadioButton.CommandParameter>
<xaml:ElementTheme>Light</xaml:ElementTheme>
</RadioButton.CommandParameter>
</RadioButton>
</Page>

Refer to the Doc: Download and install the Windows UI Library
In the NuGet Package Manager, select the Browse tab and search for
Microsoft.UI.Xaml or WinUI. Select which Windows UI Library NuGet
Packages you want to use (the Microsoft.UI.Xaml package contains
Fluent controls and features suitable for all apps). Click Install.

Related

Avalonia : how to create an avalonia control library

I have been looking all over the internet and I cannot find how to create a library with avalonia controls (to be used in other projects).
what type of project do I need to start (in the templates I do not see anything like an avalonia (control) library (don't think it is resources dictionary, would be weird)) ?
if it is just a standard library, what are the required nuget packages (currently desktop only needed) ?
where do I put the compiled dlls best in the using project ?
I'm using Avalonia preview 11.4 on Windows 11.

Unable to create a nuget package out of a custom control in xamarin forms

I just created a simple custom control in my xamarin.forms project and want to use the same control as a nuget package in my other projects. After creating the .nupkg file I tested it by adding as a local package in another xamarin forms project.The issue is the package I created is installed,but the contents inside it are not available.. Can anyone help me on resolving this..
You have to tell visual studio to pack the content of a library and generate a nuget package. This will then include the dll in the package and allow you to access it from other projects.
You can see how to do this in Visual Studio here
Including Xaml files is trickier, but if you can do the UI in code it easier enough. I created Xamarin.Forms control library on github that might be a good place to start.

Xamarin Forms code sharing

I'm working on a xamarin forms (PCL) project (A basic customer care chat app which is meant to run on Android and iOS only) that has just two xaml pages, custom renderers and few dependencies. This project is meant to be implemented into another existing project (which I don't have access to its source code) such that an action would be binded to a button on the existing app to show a page on my own project.
There is need for me to share my chat project with my client's developer but without exposing my source codes, perhaps compiling to dll or nuget package that would be added to the existing project to access my project's functions and pages. I have searched through the xamarin forum and here on stackoverflow but can't seem to lay my hands on a solution.
Is this possible at all? If yes, what am I missing? If no, is there any better option to use?
Please do note that the chat app completely done, so I'm hoping perhaps there's a way I could directly convert the project to a Nuget package.
Thanks in anticipation!
If the host application is a Xamarin Forms one:
-Move your cross platform shared code into a PCL or .Net Standard (ContentPages, ContentViews, Classes).
-Move your Renderers and platform specific code to Android and iOs Class Libraries.
Your client will have to reference your first assembly (dll) in their XF assembly in order to instantiate/manipulate your views/classes and platform specifics one on their Back-end side (taking into account your renderers, effects, etc ...)
A lot of Xamarin Controls Libraries Open Source hosted on Github are working like that. For example this one: https://github.com/jamesmontemagno/Xamarin.Forms-PullToRefreshLayout
If the host application is a native application, take a look into Xamarin forms embedding
Finally, I seem to solve the problem by enabling visual studio to build Nuget packages for the chat app project (summing up to 3 nuget packages) on project build.
Thanks #Rudy Spano and #Micah Switzer for your contributions

XAML Designer not loading WinRT Toolkit for windows phone 8.1

I'm trying to use the WinRT Toolkit for wp 8.1 in my project. I installed the package from nuget and have written this snippet in the main grid.The Emulator works just fine. but The XAML Designer is not loading the control, what do I need to do?
<faysal:CascadingTextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="fafdsda"
FontSize="35"
/>
the namespace in the xaml is like below
xmlns:faysal="using:WinRTXamlToolkit.Controls"
WinRT XAML Toolkit doesn't have good support for design view unfortunately. CascadingTextBlock is one of the controls that simply doesn't show up in the designer.
To install WinRT XAML Toolkit - Data Visualization Controls, run the following command in the Package Manager Console
Install-Package WinRTXamlToolkit.Controls.DataVisualization
then xmlns:faysal="using:WinRTXamlToolkit.Controls"

How do I install DotNetZip?

As I am pretty new to Visual Studio, this question may sound kinda dumb:
How do I install DotNetZip library? I am using Visual Studio Express 2012 for Windows Desktop.
There is no setup for DotNetZip.
Simply download the package from its site, decompress the library somewhere in your disk and set the reference from your project to the release folder appropriate for your project type. Remember to distribute the DLL with your application.
Another simple way would be to use nuget extension to install the library.
There are many ways to add DotNetZip file in your project. I have mention only two ways below:
Way 1:
1. In Visual Studio go to- Tools->NuGet Package Manager -> Package Manager Console
2. Select your project from Default Project drop-down in Package Manager Console.
3. Type Install-Package DotNetZip and press enter.
Automatically the package will be included in your project.
Note: Sometime it does not work as expected.
Way 2:
1. In Solution Explorer go to your Project, then References folder.
2. Right click on References folder -> Manage NuGet Packages.
3. On the pop up window select Online from left menu.
4. Type DotNetZip on Seach text box.
5. From loaded list click Install button.
Manage NugGet Package PopUp window