OpacityMask missing in UWP - xaml

Any easy way to apply OpacityMask to a UI object in UWP XAML?
I used to do that in WPF but appears to be missing in UWP.

You can partially replicate this functionality, but not in an especially easy way. Windows Composition API offers a similar functionality where you can define a CompositionMaskBrush with which you will "paint over" the UI object to achieve a opacity mask effect.
There is an example as the solution of a GitHub issue that demonstrates such process. The same user also asked on StackOverflow.
You can also check out the CompositionProToolkit that might simplify implementing this.

Related

Xamarin.Forms embed native controls for WPF

Following Native Views in XAML I see that it is possible to embed native views in XAML by specifying a value for targetPlatform in an appropriate xmlns attribute value.
In my sample project I have confirmed this works for UWP by using targetPlatform=Windows. This actually works fine.
However I wish to do the same thing for a WPF control and was wondering which targetPlatform value to use. I see from the article that targetPlatform should be set to one of values of the TargetPlatform enumeration. Looking at the documentation for TargetPlatform enumeration I see that it is obsolete and does not have a value for WPF. (I tried to use Other but this does not work.)
I see that Device.RuntimePlatform may be used in code, but not sure if there is a way to use it with the xmlns attribute.
How do I conditionally embed WPF native views in XAML? If this is not possible, what's the best way to do this?
At the moment WPF support is in beta and it is not possible, as you can see it is on TODO list at the moment: https://github.com/mohachouch/forms-wpf-progress/blob/master/Status.md
You can port any view using the custom renderer, but adding and binding properties even for just one control is a huge work.

Avalonia UI Carousel Example

I'm rather new to Avalonia UI / XAML / .NET MVVM in general. While I really like Avalonia so far, it's still in beta and lacks extensive documentation. Hence I sometimes struggle to get specific things working or finding out how I should use them correctly.
Could somebody point me to an example using the Carousel control? Which properties should I set in the xaml, what kind of item list should be behind it etc?
Cheers.
You can find usage example in ControlCatalog project from the main repository:
https://github.com/AvaloniaUI/Avalonia/blob/master/samples/ControlCatalog/Pages/CarouselPage.xaml
https://github.com/AvaloniaUI/Avalonia/blob/master/samples/ControlCatalog/Pages/CarouselPage.xaml.cs

Using Path Animation in Windows 8 using XAML

I would like to animate a UI control (an Image actually) over a Path provided.
It is looking that it is not possible to do it in Windows 8 using XAML although it was possible with .NET 4.5 as far as I could see from the below reference.
http://msdn.microsoft.com/en-us/library/ms746981.aspx
My question is whether there is a work around that I can use to achieve my goal or get closer to it.
WinRT is very similar to Silverlight, so many Silverlight solutions can work in WinRT with minimal or no changes. This sample on CodeProject should give you DoubleAnimationUsingPath with little work.
http://www.codeproject.com/Articles/30819/Animation-Along-a-Path-for-Silverlight

How to TILE a background image in WinRT?

With the absence of VisualBrush in WinRT, I am not sure the approach. Anyone?
At the moment I don't believe there is a way, while ImageBrush inherits from TileBrush it's missing the important property TileMode. It's unclear whether this will be included in later versions.
Indeed there hasn't been much information given in regards to XAML styling WinRT besides
changing Dark and Light themes...
so I guess we have to fiddle and experiment...
While doing some googling on the web I came with the following link... might as well give it a shot...
Creating tiled backgrounds in Metro style XAML apps
http://www.robfe.com/2012/07/creating-tiled-backgrounds-in-metro-style-xaml-apps/
Note that it might work in full screen though I ain't sure on how well it responds to snap and rotation.
http://www.mindscapehq.com/ now have a TiledBackground control.
http://www.philliphaydon.com/2013/01/windows-store-app-tiled-background/
<ms:TileBackground ImageSource="/Assets/debut_dark.png" />
Requires a license to access the nightly build.

Make another app's windows borderless

Is there any way to remove the window border (i.e., make the style NSBorderlessWindowMask) for a window that belongs to another application?
Those windows don't belong to your application. Your only hope is hackery.
Look into something like SIMBL to inject code into the other applications. There's also ApplicationEnhancer.
Good luck - screw-ups here can destablize others' apps or the entire system. Also, I highly doubt Apple will let you play in their App Store if your app does this.