Windows phone wrapPanel does not exist error - xaml

I have a xaml which has the following code.
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<toolkit:WrapPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
Now the error says that
The name wrappanel does exist in the namespace clr-namespace:Microsoft.Phone.Controls etc...
Any idea how to fix it.

You need to add the namespace to the root element of the page and you also need to reference it in your project either directly from the disk or by using NuGet:
Install-Package WPToolkit
In your XAML add the following:
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"

Try reinstalling the package, it worked

It's not working because Windows Phone toolkit is only available for
Windows Phone Silverlight Applications.

Related

How can I find namespace in 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.

Expander was not found in Xamarin Forms 5.0.0

I have an Expander that has always worked in my application. I updated Xamarin Forms to version 5.0.0 and XAML signaled me an error, the control no longer exists.
The type 'Expander' was not found. Verify that you are not missing an
assembly reference and that all referenced assemblies have been built.
Has it changed its name? was it deleted ?
Expander has been moved to Xamarin Community Toolkit package under the namespace (source).
xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
Questions related to Expander on SO
Official documentation: https://learn.microsoft.com/en-us/xamarin/community-toolkit/views/expander
Official repo: https://github.com/xamarin/XamarinCommunityToolkit

WP8.1 String Resource in ResourceDictionary

How do I define a string in a ResourceDictionary in my WP8.1 app?
I already added
xmlns:sys="clr-namespace:System;assembly=mscorlib"
to my ResourceDictionary but Visual Studio 2013 says that "sys:String" wasn't found.
How can I fix that?
The problem is probably becouse you are targetting WP8.1 Runtime app. As method you have described will still be working in WP8.1 Silverlight, in Runtime you can declare build-in types in xaml like this:
<x:String x:Key="myKey">Text</x:String>
More about differences and porting Silverlight app to Runtime you will find here at MSDN.

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"

Can't create flyout in Windows Phone 8.1 Silverlight app

Adding a flyout seemed like a pretty straightforward task, but I can't seem to even initialize one on my app (which is based on a PivotControl app template for Windows Phone 8.1 Silverlight). When I attempt to do this:
<phone:PhoneApplicationPage.Resources>
<Flyout x:Key="MyFlyout"></Flyout>
</phone:PhoneApplicationPage.Resources>
I immediately get a blue squiggly line below Flyout saying "The name Flyout doesn't exist in the namespace http://schemas.microsoft.com/clients/2007". What gives?
<Flyout> is only available in Windows Phone 8.1 runtime (Silverlight is a no-go). See the MSDN Reference FlyOut.
If you want something similar to a <Flyout> that would work for Silverlight, download and install the Windows Phone Toolkit -- NuGet or get it here : The Windows Phone Toolkit
Using the <toolkit:ContextMenuService.ContextMenu>
<container_ui>
<toolkit:ContextMenuService.ContextMenu>
<toolkit:ContextMenu>
<toolkit:MenuItem Header="menu_1" Click="Click_Event"/>
<toolkit:MenuItem Header="menu_2" Command="{Binding CommandBinding}"/>
</toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>
</container_ui>