Is it possible to use platform native (Windows) XAML in Maui? - xaml

This is a bit of a continuation to How could one to merge resource dictionaries either dynamically or in compile time? (or to .NET MAUI: can we also have platform-specific XAML?).
I was reading https://learn.microsoft.com/en-us/windows/apps/design/style/xaml-theme-resources#the-xaml-type-ramp to see about Fluent design guidelines. Then I thought about applying them to Maui. Using "the technique of merge dictionaries" I thought that maybe it's possible to take Windows native XAML from https://github.com/microsoft/microsoft-ui-xaml/blob/cb181acede22577c59c5dc250361d3340252f4e9/dev/CommonStyles/TextBlock_themeresources.xaml#L21 and put that to Windows only XAML.
But of course that does not work like that, since eventually the Maui XAML compiler and Maui application load the XAML and they do not recognize that. Even if it would involve only Windows platform.
But I wonder if someone knows to tell if it is possible (or not) use Windows native XAML like that?
I suspect the answer is similar to Can I use existing WinUI3 controls in MAUI project?, but I'll ask explicitly in any case.

No; that wouldn't make sense:
WIndows XAML represents WinUI 3 controls (part of Windows App SDK), and their properties. Many properties are specific to Windows.
Maui XAML has its own cross-platform controls. These are designed to be easily mapped to native controls on different platforms.
This is sort-of-like asking if iOS APIs can be used on Android. Not compatible.
Though the differences are not as extreme as between iOS and Android; see next section.
OTOH, there are strong similarities in some features between all XAMLs (WPF, Xamarin.Forms/Maui, Windows): XAML Standard; XAML dialect alignment.
That doc explains the situation; Microsoft did not succeed in making a "common subset" that all XAMLs would support.
But they did identify differences, and have made a few additions here and there to increase similarity.

Related

Alternative to Scrollviewer in Telerik Silverlight

Our company is currently using both the Telerik Silverlight tools and the Silverlight Toolkit to accomplish what we need in our program. Since Silverlight is dying out and the Silverlight Toolkit has not been updated since 2011, we are removing all dependencies on the Silverlight Toolkit and trying to replace those controls with a Telerik Alternative so that we are not using both toolkits. This way our customers only needs to download a 5mb file rather than a 10mb fileI've gone through and removed just about every dependency except two, one of which is the ScrollViewer. We use the Scrollviewer several times to create a scrollable area within another grid etc. I've looked around and found that Telerik doesn't have a direct alternative to the ScrollViewer but they do have some scrolling functionality within their RadGridView. That won't exactly work for us, and either way it will be slow because is we put a RadGridView where the ScrollViewer is, we would be placing it in controls that have auto sizing or measure with infinity. According to Telerik's site: Try not to place RadGridView in controls/panels which will measure it with infinity. Either way that seems like it would be very cluttered in our case.I was wondering if there was some ScrollViewer alternative in Telerik that I'd be able to use. If worst comes to worst, does making our own custom ScrollViewer seem reasonable?Any help is appreciated. Thanks!
EDIT: More specifically, the ScrollIntoView() function in the ScrollViewerExtensions from the Silverlight 5 Toolkit needs replacing. If there is no other control that has the built in functionality to scroll to an object within the control, then I can probably just create the method myself.
I'm not sure if Telerik has similar ScrollViewer extensions, but one solution would be to copy-paste the relevant code from the Silverlight Toolkit source -- the ScrollViewerExtensions class.

Adding Monogame to the existing Xamarin project

A Xamarin newbie here. I have recently started developing a cross-platform mobile application using Xamarin with Visual Studio. There is now an idea to introduce an application framework to manage graphics and animations, such as Monogame. I've looked at the tutorials and it looks like that I had to start using Monogame from the beginning, as I couldn't find a way to use it with an existing project. So, I am wondering is there such a possibility at all?
How are you wishing to integrate it? It is possible to instantiate a Game class from a button touch or some other user input. From that you point on you are solely inside of MonoGame until the game is closed. The only issue i came across with this is removing the game and handing control back to the main application as this is not how MG was designed to be used.

Mono Control Drawing?

I was wondering how Mono draws its controls ? I'm thinking of using it for a cross platform program but I can't find any comparisons of what it looks like on each platform (the lack of media on their official website is also concerning). I may also want to create my own controls with my own drawing functions so I was wondering if it does something like Qt in that it handles all it's own drawing so it looks the same across platforms.
All Mono Winforms control drawing is done by Mono in C# using System.Drawing. Controls look like Win32 classic on all platforms.
Some screenshots are available on the screenshots page:
http://mono-project.com/Screenshots
Note you'll want to scroll down for Winforms.

Metro XAML - Where Is LayoutTransform ?

Im authoring some Windows 8 Metro template (custom) controls and there doesnt seem to me any LayoutTransform properties on anything.
this is a real pain, as I want to rotate some text 90 desgrees, but the grid is sizing to the size of the text before the rotation.
Does anyone have an idea on how to fix this without writing lots of hacks ?
Dean
I modified the Silverlight toolkit version and published it here
Layout transform in Windows 8 XAML
LayoutTransform was gone in Silverlight too. (IMHO) I guess maybe it was usually overused or abused in WPF causing performance issues, so for better perception of the framework - it was never added to Silverlight and by extension - to WinRT.
There seems to be a workaround for that in the Silverlight Toolkit that should be easy to port - check the LayoutTransformer control. I have never used it, but it sounds like what you need.
*Edit 2017-04-24
There's a LayoutTransformControl in WinRT XAML Toolkit you could use.

What programming languages have access to the WinAPI?

I'm looking to start a new programming language and for my first task I want to overlay some text on another applications window, similar to the guy in this post:
Overlay text on some else's window - HUD
Clearly from that post, this can be done in VB.NET, and extrapolating from that, I can probably safely assume that C++\C# can also do this similarly.
My question is; are there any other languages that can do the same? Can Ruby do it? :)
I'm looking for the following capabilities:
Enumerate open windows to find the one I want to overlay on top of.
Overlay text on the 3rd party apps window. (Rich text is a bonus)
Detect window bounds so I can resize the text when the user resizes the window.
Allow click-through of my created text so it doesn't interfere with the 3rd party apps functionality.
Any ideas?
If you want to use Ruby, you have two options: IronRuby and "classic Ruby".
I guess IronRuby would be the preferred option on Windows as it runs on top of .NET and has access to full Windows API through that.
If .NET is too much for your needs and you need to do something simple, then classic Ruby might be a better fit.
For classic Ruby, check out these pages:
Ruby and Microsoft Windows
Microsoft Windows Support
Beware: argument packing and unpacking is not very convenient.