Questions tagged [winrt-component]

Windows Runtime Component and WinRT Component Libraries are concepts related to language runtime interoperability in Windows Runtime - the modern development platform for Windows and typically used in Windows Store applications. Use this tag to denote any questions related to creating WinRT Components, WinRT Component Libraries and typically to limitations imposed by the rules of creating WinRT Components.

From Wikipedia:

Classes that are compiled to target the WinRT are called WinRT components. They are classes that can be written in any supported language and for any supported platform. The key is the metadata. This metadata makes it possible to interface with the component from any other WinRT language. The runtime requires WinRT components that are built with .NET Framework to use the defined interface types or .NET type interfaces, which automatically map to the first named. Inheritance is as yet not supported in managed WinRT components, except for XAML classes.

Windows Runtime applications can be written using any combinations of the three major runtimes - native, .NET and JS as long as these components are exposed across ABI (application binary interface) following rules such as - public classes need to be sealed, method arguments and return types need to be WinRT types themselves or have direct projection to those (such as Windows.Foundation.Uri with System.Uri or Platform::String and System.String or many of the other basic types having counterparts in different language runtimes).

114 questions
1
vote
2 answers

How do you install a Windows Runtime Component built in C++/CX into a C# project?

I have a library called foo, which is written in C++/CX. I chose a Windows Runtime Component because I want it to be projected into C#, C++ and JavaScript. Also, I want to be able to distribute the library, and I don't want to require/allow the…
Zak
  • 12,213
  • 21
  • 59
  • 105
1
vote
0 answers

How to Access DataTemplate inside a ResourceDictionary in code behind in WinRT?

I have defined a DataTemplate inside a ResourceDictionary. I need to access the DataTemplate in the code behind. (i.e) I need to set this DataTemplate defined inside a ResourceDictionary to a ContentControl.ContentTemplate property in the code…
Harikrishnan
  • 1,474
  • 2
  • 11
  • 25
1
vote
1 answer

Can a HTML/WinJS View use a user control built in XAML/C#?

I am hesitant to develop a Windows Phone app in the HTML/WinJS Universal App space because of the difficulty of building complex user controls. Before I go the XAML/C# route, I would like to find out if it is possible to use a user control built in…
1
vote
1 answer

How can I programatically tap an AppBarButton?

I have this code: async private void InformUserOfRenameOption(string platypusName) { CoreWindowDialog cwd = new CoreWindowDialog(String.Format( "This platypus has been given the default name {0}. Do you want to change it?",…
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
1
vote
1 answer

Does protobuf-csharp-port support Windows RT?

protobuf-csharp-port homepage(with sourcecode) In my previous windows phone silverlight 8.0 project I used protobuf-csharp-port to implement the GPB, but now I want to port the project to windows 8.1 and then universal,so I copy the source code to…
1
vote
1 answer

How to implement a Brokered Component: Windows Store App

Using the instructions from here: http://visualstudiogallery.msdn.microsoft.com/527286e4-b06a-4234-adde-d313c9c3c23e Running Visual Studio 2013 as Admin with Update 2. I create a C# BWRC project, TestBwrc. In Class.cs I add an int property that…
0
votes
0 answers

Getting access denied when using WinRT API's in react-native for windows project

Im doing A React-Native for windows app and I'm using WinRT Api's for accessing the Windows.System namespace for using the ProcessLauncher class to execcute a file and a command when clicking a button on my app. The problem is that when doing it I'm…
0
votes
1 answer

How to take a screenshot from a background thread using WinRT?

I'm having issues with WinRT ScreenCapture blocking/freezing my UI. My app is looping through selected windows and takes a screenshot of each every few seconds. Every time a screenshot is taken the UI animation is lagging and sometimes the UI just…
Ben
  • 793
  • 2
  • 13
  • 29
0
votes
0 answers

Can't add C# WinRT component to C++ WinRT UWP project

I am following the guide here, but I am using a C++ WinRT UWP project to consume the C# component instead of the C++ WinRT console project in the guide. However, it failed to add the C# component project as a project reference. My .csproj
sz ppeter
  • 1,698
  • 1
  • 9
  • 21
0
votes
0 answers

Winrt API Python getting Bluetooth signal strength

I am trying to measure Bluetooth signal strength using winrt APi in python using winsdk. My workflow is to measure Bluetooth Signal strength of a device that is already connected with my Windows machine. I followed the guideline from Pywinrt…
0
votes
0 answers

0x80070005 E_ACCESSDENIED when debugging WinRT Windows.Net.Http on a Low Integrity Level process

Please see sample projects at https://github.com/jurocha-ms/LowILAccessDenied. An E_ACCESSDENIED error is thrown when attaching a debugger (Visual Studio) to a Windows process with Low Integrity Level. This is a snippet of the failing code: using…
juniel_katarn
  • 330
  • 4
  • 11
0
votes
0 answers

How to use IObservable in WinRT?

I'm trying to develop a WinRT library in C# that exposes some classes with public properties of type IObservable to make use of Reactive Extensions for .NET. The documentation for Rx.NET states that, as of v5.0, WinRT is fully supported as long as…
jasonxz
  • 139
  • 1
  • 9
0
votes
0 answers

How can my C# Windows Runtime Component install the WebView2 Runtime?

Pretty simple question. I know how to find out if it's been installed. But, if it hasn't....how do I install it? All of the documentation appears to be geared towards C++ where you can just run Shell commands. I also found something where you…
jasonxz
  • 139
  • 1
  • 9
0
votes
1 answer

How to access the GetDoubleClickTime Win32 API function from a WinUI 3.0 Runtime Component library

I'm trying to call the GetDoubleClickTime Win32 API function using C++ from a new project created with the "Windows Runtime Component (WinUI 3)" Visual Studio template. To do so, I'm adding #include to the pch.h file and then simply call…
ackh
  • 1,648
  • 2
  • 18
  • 36
0
votes
0 answers

Cannot compile WinUI 3.0 app that references a custom Windows Runtime component

I have a Visual Studio 2019 solution that contains two project. The first project has been created using the "Windows Runtime Component (WinUI 3) Visual Studio template (library project). It generates a dll and associated winmd file that contains a…
ackh
  • 1,648
  • 2
  • 18
  • 36