I have added the below tag to my xaml but it didn't get recognized.I have the namespace xmlns:bing="using:Bing.Maps" added in the list of namespaces.
I have also installed bing sdk for wondows store from
http://visualstudiogallery.msdn.microsoft.com/bb764f67-6b2c-4e14-b2d3-17477ae1eaca
That control has been deprecated. If you can use the new map control in the Microsoft.Phone.Maps.Controls namespace. How-To
Related
I want to encapsulate frame navigation in custom command und use this command declaratively as a static ressource. I found
Frame.Navigate(typeof(MainPage));
which expects a type parameter (type of the target page) to navigate to. My first attempt was to use a generic ICommand implementation that passes the type of the target page as generic type parameter. As of x:TypeArguments is not supported for Windows Store Apps, I tried to define a property
public Type TargetType { get; set; }
for the command. But no luck again: if I try to set the property via a xaml attribute
`<NavigationCommand TargetType="MainPage">
I get a compile-time error saying
MainPage is not supported in a Windows universal project
This should work:
<NavigationCommand TargetType="ns:MainPage">
Where ns is an XML namespace prefix declared with xmlns:ns="using:TheNamespaceInCode"
(note: the x:Type markup extension used in WPF isn't supported in WinRT)
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 am currently designing an app with the Metro app framework which includes a live video chat feature. I am using the GrayscaleTransform MFT included in the MediaCapture sample (at this point simply copy-and-pasted from the sample).
However, when I try to add the grayscale effect to the camera's image stream, I get a "class not registered" fatal error. I understand this is because I must 'activate and register' the media extension, but I do not know how. How do I register the media extension?
All help is greatly appreciated and I always accept an answer!
UPDATE: My GrayScale IDL file is shown below:
import "Windows.Media.idl";
#include <sdkddkver.h>
namespace GrayscaleTransform
{
[version(NTDDI_WIN8), activatable(NTDDI_WIN8)]
runtimeclass GrayscaleEffect
{
[default] interface Windows.Media.IMediaExtension;
}
}
The media extension is specified as an <Extension> (or extensibility point) in the package manifest's Extensions section, but you need to insert it manually (i.e. open the appxmanifest as code instead of double-clicking.)
Using the GrayscaleTransform example, in the Media extensions sample, open the MediaExtensions project's package.appxmanifest (as code) and look for this in the <Extensions> section:
<Extension Category="windows.activatableClass.inProcessServer">
<InProcessServer>
<Path>GrayscaleTransform.dll</Path>
<ActivatableClass ActivatableClassId="GrayscaleTransform.GrayscaleEffect" ThreadingModel="both" />
</InProcessServer>
</Extension>
There's a bit more general info on extensions in App contracts and extensions.
As Chris Bowen explains in his answer, your application's AppXManifest is missing the required Extension elements for the activatable classes in the media extensions modules. All (non-Windows-provided) activatable classes need to be listed in the AppXManifest. The solution of adding the Extension nodes to the AppXManifest yourself will work, and this is what the MediaExtensions sample applications appear to have done.
However, you should not normally need to hand-edit the list of extensions. If you add a reference to a Windows Runtime Component project, a loose WinMD file, or an extension SDK, the build should automatically generate Extension elements for each of the activatable classes in the referenced components.
The reason this is not happening is that the media extensions are not annotated with the [activatable] attribute in IDL, so they are not attributed with the ActivatableAttribute in the WinMD that is generated. Instead of hand-editing the AppXManifest, you can declare the type as activatable in its IDL definition.
For example, to update GeometricSource.GeometricSchemeHandler, you can change its definition in IDL from:
[version(NTDDI_WIN8)]
runtimeclass GeometricSchemeHandler
{
}
to:
[version(NTDDI_WIN8), activatable(NTDDI_WIN8)]
runtimeclass GeometricSchemeHandler
{
[default] interface Windows.Media.IMediaExtension;
}
Note the added activatable attribute and the added [default] interface. If you make these changes to each of the extensions and clean/rebuild, you should not need to explicitly specify the activatable types in your AppXManifest: the build system will add them automatically.
There is not [XmlnsDefinition] attribute in XAML metro style applications, based on WinRT.
How my custom namespace mappings from WPF/SL apps should be migrated to WinRT XAML apps?
Looks like XmlnsDefinitionAttribute is missing. There is XmlnsDefinition struct but that is of not much use since there is no way to use it to set custom namespace mappings.
A discussion at https://social.msdn.microsoft.com/Forums/windowsapps/en-US/026baea0-6324-46ee-956a-72dbb4c90ca1/xmlnsdefinition-replacement-in-winrt?prof=required says:
there is no analogous attribute.
You might be able to provide similar data in a custom
IXamlMetadataProvider implementation, but since that is automatically
generated for you I'm not sure it can be overridden.
VB.NET automatically prefixes the root namespace set in the project properties to the namespace of each class. This is different from C#, where the full namespace must be declared each time.
Is it possible to override this behaviour, creating a namespace outside of the root namespace?
If I understand you correctly you just need to set a blank namespace in the project properties dialog and then set namespaces within each source file using Begin/End Namespace commands.
From VS2012 onwards it's possible to get around this, see stackoverflow.com/a/17360357/233095
Defining the default for the project as blank and then taking total control in each class allows you to do what c# does. However certain project types (Library I believe) do not allow you to change the default namespace to blank.
Use of the Global keyword does not allow you to jump out of the root namespace either:
http://msdn.microsoft.com/en-us/library/16czfx55.aspx
They now implemented it:
Namespace Global.MyNamespace
End Namespace
You can change the namespace of the entire project by going to properties on the project.
else you will have to have a empty root namespace and set the name space in each file with the
Namespace test
class.....
End Namespace